summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharlie Swanson <charlie.swanson@mongodb.com>2020-08-21 17:56:41 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-01-14 20:01:28 +0000
commit408474bcb949872e8757b6b3e4dca2dc3816462c (patch)
tree8010b660a9a76d8dae4ca4ad4f114a58e86979b5 /src
parentb924fabb581e11bf7534d5141f44f127dac03f1a (diff)
downloadmongo-408474bcb949872e8757b6b3e4dca2dc3816462c.tar.gz
SERVER-49882 Log status in the catch block in JSThread::run()
(cherry picked from commit ce6cfc30df7f5545e19a2cdf84b94777eaa3b4de)
Diffstat (limited to 'src')
-rw-r--r--src/mongo/scripting/mozjs/jsthread.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/scripting/mozjs/jsthread.cpp b/src/mongo/scripting/mozjs/jsthread.cpp
index 5e039e5b51e..26641044afc 100644
--- a/src/mongo/scripting/mozjs/jsthread.cpp
+++ b/src/mongo/scripting/mozjs/jsthread.cpp
@@ -27,6 +27,8 @@
* it in the license file.
*/
+#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kDefault
+
#include "mongo/platform/basic.h"
#include "mongo/scripting/mozjs/jsthread.h"
@@ -36,6 +38,7 @@
#include <vm/PosixNSPR.h>
#include "mongo/db/jsobj.h"
+#include "mongo/logv2/log.h"
#include "mongo/platform/mutex.h"
#include "mongo/scripting/mozjs/implscope.h"
#include "mongo/scripting/mozjs/valuereader.h"
@@ -188,6 +191,9 @@ private:
thisv->_sharedData->_returnData = scope.callThreadArgs(thisv->_sharedData->_args);
} catch (...) {
auto status = exceptionToStatus();
+ LOGV2_WARNING(4988200,
+ "JS Thread exiting after catching unhandled exception",
+ "error"_attr = status);
thisv->_sharedData->setErrorStatus(status);
thisv->_sharedData->_returnData = BSON("ret" << BSONUndefined);
}