summaryrefslogtreecommitdiff
path: root/src/mongo/shell/explainable.js
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2015-07-20 14:18:41 -0400
committerSpencer T Brody <spencer@mongodb.com>2015-07-22 10:42:46 -0400
commitf37cf89f8eddc57dc1df5e3c0b0f2ae25388afd0 (patch)
treed745f438c704bf83c82697ac0ce681c07626c831 /src/mongo/shell/explainable.js
parent280b8e6c835bab826899a7696a1f5852e1221d53 (diff)
downloadmongo-f37cf89f8eddc57dc1df5e3c0b0f2ae25388afd0.tar.gz
SERVER-19493 Include 'code' field in thrown js Error objects where possible
Diffstat (limited to 'src/mongo/shell/explainable.js')
-rw-r--r--src/mongo/shell/explainable.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/shell/explainable.js b/src/mongo/shell/explainable.js
index 7d6438fc7b3..68d83643ed8 100644
--- a/src/mongo/shell/explainable.js
+++ b/src/mongo/shell/explainable.js
@@ -31,7 +31,7 @@ var Explainable = (function() {
var throwOrReturn = function(explainResult) {
if (("ok" in explainResult && !explainResult.ok) || explainResult.$err) {
- throw Error("explain failed: " + tojson(explainResult));
+ throw _getErrorWithCode(explainResult, "explain failed: " + tojson(explainResult));
}
return explainResult;