summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2015-11-09 15:37:51 -0500
committerRandolph Tan <randolph@10gen.com>2015-11-11 15:06:27 -0500
commit065197c7d656e420d0abfbd4ce8a5b18886ff63d (patch)
tree1bc069c874ce366d6a9c77130b9dac65517f837c /src
parent547d3bc47066f780379dc388ae11e87d210f800c (diff)
downloadmongo-065197c7d656e420d0abfbd4ce8a5b18886ff63d.tar.gz
SERVER-21405 Add more context for shell error message "error doing query: failed"
Diffstat (limited to 'src')
-rw-r--r--src/mongo/shell/db.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/shell/db.js b/src/mongo/shell/db.js
index 60adba66db9..d3b0fa73634 100644
--- a/src/mongo/shell/db.js
+++ b/src/mongo/shell/db.js
@@ -129,7 +129,7 @@ DB.prototype.commandHelp = function( name ){
// for a command failing due to a connection failure, we preserve it for backwards
// compatibility. See SERVER-18334 for details.
if (ex.message.indexOf("network error") >= 0) {
- throw new Error("error doing query: failed");
+ throw new Error("error doing query: failed: " + ex.message);
}
throw ex;
}
@@ -294,7 +294,7 @@ DB.prototype.shutdownServer = function(opts) {
}
catch (e) {
// we expect the command to not return a response, as the server will shut down immediately.
- if (e.message === "error doing query: failed") {
+ if (e.message.indexOf("error doing query: failed") >= 0) {
print('server should be down...');
return;
}