summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/base/validate_locale.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mongo/base/validate_locale.cpp b/src/mongo/base/validate_locale.cpp
index ffb7190c804..b51eac53edb 100644
--- a/src/mongo/base/validate_locale.cpp
+++ b/src/mongo/base/validate_locale.cpp
@@ -32,6 +32,7 @@
#include <locale>
#include "mongo/base/init.h"
+#include "mongo/util/mongoutils/str.h"
namespace mongo {
@@ -40,13 +41,15 @@ MONGO_INITIALIZER_GENERAL(ValidateLocale, MONGO_NO_PREREQUISITES, MONGO_DEFAULT_
try {
// Validate that boost can correctly load the user's locale
boost::filesystem::path("/").has_root_directory();
- } catch (const std::runtime_error&) {
- return Status(ErrorCodes::BadValue,
- "Invalid or no user locale set."
+ } catch (const std::runtime_error& e) {
+ return Status(
+ ErrorCodes::BadValue,
+ str::stream()
+ << "Invalid or no user locale set. "
#ifndef _WIN32
- " Please ensure LANG and/or LC_* environment variables are set correctly."
+ << " Please ensure LANG and/or LC_* environment variables are set correctly. "
#endif
- );
+ << e.what());
}
#ifdef _WIN32