From fa31a6ed43cc92c3bddfa2054bddd51f24fd61f9 Mon Sep 17 00:00:00 2001 From: kewde Date: Tue, 29 Apr 2025 14:04:05 +0200 Subject: [PATCH] fix: make v8::Exception a string before calling ToSTLString --- src/v8runtime/V8Runtime.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/v8runtime/V8Runtime.cpp b/src/v8runtime/V8Runtime.cpp index 7b48397..c7a2fe4 100644 --- a/src/v8runtime/V8Runtime.cpp +++ b/src/v8runtime/V8Runtime.cpp @@ -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::Local message = tryCatch->Message(); if (message.IsEmpty()) { // V8 didn't provide any extra information about this error; just