Skip to content

Commit 3b25e9a

Browse files
committed
fix: error format for print message
1 parent 901f621 commit 3b25e9a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

NativeScript/runtime/NativeScriptException.mm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@
128128
jsErrorOccurred = true;
129129
Log(@"***** JavaScript exception occurred "
130130
@"in debug mode *****\n");
131-
Log(@"%@", reasonStr);
131+
Log(@"%s", fullMessage.c_str());
132+
Log(@"%s", stackTrace.c_str());
132133
// NSLog(@"🎨 CALLING ShowErrorModal for OnUncaughtError - should display beautiful branded "
133134
// @"modal...");
134135

@@ -150,7 +151,7 @@
150151
// Use the same comprehensive fullMessage that the terminal uses (identical stack traces)
151152
std::string completeStackTrace = reasonStr ? [reasonStr UTF8String] : fullMessage;
152153
Log(@"***** End stack trace - Fix error to continue *****\n");
153-
ShowErrorModal(errorTitle, errorMessage, completeStackTrace);
154+
ShowErrorModal(errorTitle, errorMessage, stackTrace);
154155

155156
// Don't crash in debug mode - just return
156157
return;
@@ -437,7 +438,7 @@
437438
if (app.windows.count == 0 && app.connectedScenes.count == 0) {
438439
Log(@"Note: JavaScript error during boot.");
439440
Log(@"================================");
440-
Log(@"%@", [NSString stringWithUTF8String:stackTrace.c_str()]);
441+
Log(@"%s", stackTrace.c_str());
441442
Log(@"================================");
442443
Log(@"Please fix the error and save the file to auto reload the app.");
443444
Log(@"================================");

0 commit comments

Comments
 (0)