Skip to content

Commit 480fd18

Browse files
committed
v8: catch exception thrown with inspector modules not found
1 parent 560fd49 commit 480fd18

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

test-app/runtime/src/main/cpp/runtime/inspector/JsV8InspectorClient.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,11 +432,13 @@ void JsV8InspectorClient::registerModules() {
432432
success = global->Set(context, tns::ConvertToV8String(isolate, "__inspectorTimestamp"), func).FromMaybe(false);
433433
assert(success);
434434

435-
TryCatch tc(isolate);
436435
Runtime::GetRuntime(env)->RunModule("inspector_modules");
437-
438-
if(tc.HasCaught()) {
439-
throw NativeScriptException("Error loading inspector modules");
436+
bool pendingException;
437+
napi_is_exception_pending(env, &pendingException);
438+
if (pendingException) {
439+
napi_value exception;
440+
napi_get_and_clear_last_exception(env, &exception);
441+
throw NativeScriptException("Error running inspector modules");
440442
}
441443
}
442444

0 commit comments

Comments
 (0)