summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Kaye <tyler.kaye@mongodb.com>2017-06-16 17:08:14 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2017-08-21 18:06:05 -0400
commitce350e70c2eba716c4ea95b5660ada98817d3ea2 (patch)
tree58636cd52764ef1072cd819891f14e5c41b3c15d
parenta2c338f4887781be807f68f21eab254aa07b10b2 (diff)
downloadmongo-ce350e70c2eba716c4ea95b5660ada98817d3ea2.tar.gz
SERVER-29714 Added more detailed error logging in validate_locale.cpp to better understand the problem if it arises.
(cherry picked from commit 4201d8b14611387edfd448ba91c7195f9c6ec43c)
-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