mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:57:35 +00:00
Userland/JS: Print any exceptions after execution of a JS file
This commit is contained in:
parent
6bf47252dc
commit
3906d2b46a
1 changed files with 6 additions and 1 deletions
|
@ -335,8 +335,13 @@ int main(int argc, char** argv)
|
|||
|
||||
auto result = interpreter->run(*program);
|
||||
|
||||
if (print_last_result)
|
||||
if (interpreter->exception()) {
|
||||
printf("Uncaught exception: ");
|
||||
print(interpreter->exception()->value());
|
||||
interpreter->clear_exception();
|
||||
} else if (print_last_result) {
|
||||
printf("%s\n", result.to_string().characters());
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue