History

Throw the right exception class, and add the thrown value to it

Dale Glass committed 3 years ago

Commit cb0c6201 parent 2a5ec7d1 file · +5 −1Browse files

Showing the changes to libraries/script-engine/src/v8/ScriptEngineV8.cpp (1 of 1 file). Show all

Unified · Split

libraries/script-engine/src/v8/ScriptEngineV8.cpp+5−1
@@ -1020,7 +1020,7 @@ void ScriptEngineV8::setUncaughtException(const v8::TryCatch &tryCatch, const QS · 1019 unmodified lines
10201020 return;
10211021 }
10221022
1023− auto ex = std::make_shared<ScriptException>();
1023+ auto ex = std::make_shared<ScriptRuntimeException>();
10241024 ex->additionalInfo = info;
10251025
10261026 v8::Locker locker(_v8Isolate);
@@ -1036,6 +1036,10 @@ void ScriptEngineV8::setUncaughtException(const v8::TryCatch &tryCatch, const QS · 9 unmodified lines
10361036
10371037 ex->errorMessage = QString(*utf8Value);
10381038
1039+ auto exceptionValue = tryCatch.Exception();
1040+ ex->thrownValue = ScriptValue(new ScriptValueV8Wrapper(this, V8ScriptValue(this, exceptionValue)));
1041+
1042+
10391043 v8::Local<v8::Message> exceptionMessage = tryCatch.Message();
10401044 if (!exceptionMessage.IsEmpty()) {
10411045 ex->errorLine = exceptionMessage->GetLineNumber(getContext()).FromJust();