summaryrefslogtreecommitdiff
path: root/src/mongo/scripting
diff options
context:
space:
mode:
authorGabriel Russell <gabriel.russell@mongodb.com>2019-03-14 14:52:26 -0400
committerGabriel Russell <gabriel.russell@mongodb.com>2019-03-14 16:39:25 -0400
commit96aa8be92f1c6a69f7602aef7ef5be26b4a8a918 (patch)
tree5099272fda4aa7cf3eb7da3ab8ebfd7a0fb42f00 /src/mongo/scripting
parent28124a802a14a36b6b9dd9b1f1967100faf8aad8 (diff)
downloadmongo-96aa8be92f1c6a69f7602aef7ef5be26b4a8a918.tar.gz
SERVER-40059 build Status objects with StringData in exception.cpp
Diffstat (limited to 'src/mongo/scripting')
-rw-r--r--src/mongo/scripting/mozjs/exception.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/scripting/mozjs/exception.cpp b/src/mongo/scripting/mozjs/exception.cpp
index f6776224cd5..87b58706095 100644
--- a/src/mongo/scripting/mozjs/exception.cpp
+++ b/src/mongo/scripting/mozjs/exception.cpp
@@ -74,7 +74,7 @@ std::string currentJSStackToString(JSContext* cx) {
Status currentJSExceptionToStatus(JSContext* cx, ErrorCodes::Error altCode, StringData altReason) {
JS::RootedValue vp(cx);
if (!JS_GetPendingException(cx, &vp))
- return Status(altCode, altReason.rawData());
+ return Status(altCode, altReason);
return jsExceptionToStatus(cx, vp, altCode, altReason);
}
@@ -85,7 +85,7 @@ Status JSErrorReportToStatus(JSContext* cx,
StringData altReason) {
JSStringWrapper jsstr(cx, mongoErrorReportToString(cx, report));
if (!jsstr)
- return Status(altCode, altReason.rawData());
+ return Status(altCode, altReason);
ErrorCodes::Error error = altCode;
@@ -134,7 +134,7 @@ Status jsExceptionToStatus(JSContext* cx,
JSErrorReport* report = JS_ErrorFromException(cx, obj);
if (!report)
- return Status(altCode, altReason.rawData());
+ return Status(altCode, altReason);
return JSErrorReportToStatus(cx, report, altCode, altReason);
}