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:07:34 -0400
commit987e05d7a7a3a2dee468cc96c0faaa0ea6344ed2 (patch)
tree1c365f00c4092e309d673d83740f1bce92f33364
parentc89e23461f28bb6a0cc3684f726912278385af59 (diff)
downloadmongo-987e05d7a7a3a2dee468cc96c0faaa0ea6344ed2.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 5a4320c34c5..81207d4d89d 100644
--- a/src/mongo/base/validate_locale.cpp
+++ b/src/mongo/base/validate_locale.cpp
@@ -30,6 +30,7 @@
#include <boost/filesystem/operations.hpp>
#include "mongo/base/init.h"
+#include "mongo/util/mongoutils/str.h"
namespace mongo {
@@ -38,13 +39,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());
}
return Status::OK();
}