mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 09:49:21 +00:00
js: Improve exception output for errors with empty message
This commit is contained in:
parent
526386a6ba
commit
eb1fef2be6
Notes:
sideshowbarker
2024-07-19 07:59:34 +09:00
Author: https://github.com/linusg
Commit: eb1fef2be6
Pull-request: https://github.com/SerenityOS/serenity/pull/1579
1 changed files with 3 additions and 1 deletions
|
@ -136,7 +136,9 @@ static void print_date(const JS::Object& date, HashTable<JS::Object*>&)
|
|||
static void print_error(const JS::Object& object, HashTable<JS::Object*>&)
|
||||
{
|
||||
auto& error = static_cast<const JS::Error&>(object);
|
||||
printf("\033[34;1m[%s]\033[0m: %s", error.name().characters(), error.message().characters());
|
||||
printf("\033[34;1m[%s]\033[0m", error.name().characters());
|
||||
if (!error.message().is_empty())
|
||||
printf(": %s", error.message().characters());
|
||||
}
|
||||
|
||||
void print_value(JS::Value value, HashTable<JS::Object*>& seen_objects)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue