0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-49882 Log status in the catch block in JSThread::run()

This commit is contained in:
Charlie Swanson 2020-08-21 17:56:41 -04:00 committed by Evergreen Agent
parent b6fb9bab05
commit ce6cfc30df

View File

@ -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);
}