Skip to content

fix: make v8::Exception a string before calling ToSTLString #216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/v8runtime/V8Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,11 @@ jsi::Value V8Runtime::ExecuteScript(
void V8Runtime::ReportException(v8::Isolate *isolate, v8::TryCatch *tryCatch)
const {
v8::HandleScope scopedHandle(isolate);
std::string exception =
JSIV8ValueConverter::ToSTLString(isolate, tryCatch->Exception());
std::string exception = JSIV8ValueConverter::ToSTLString(
isolate,
tryCatch->Exception()
->ToDetailString(isolate->GetCurrentContext())
.FromMaybe(v8::Local<v8::String>()));
v8::Local<v8::Message> message = tryCatch->Message();
if (message.IsEmpty()) {
// V8 didn't provide any extra information about this error; just
Expand Down
Loading