mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 22:55:23 +00:00
LibJS+LibWeb: Log JavaScript exceptions raised by web content
Instead of hiding JS exceptions raised on the web, we now print them to the debug log. This will make it a bit easier to work out why some web pages aren't working right. :^)
This commit is contained in:
@@ -264,8 +264,7 @@ Value VM::construct(Function& function, Function& new_target, Optional<MarkedVal
|
||||
|
||||
void VM::throw_exception(Exception* exception)
|
||||
{
|
||||
#ifdef VM_DEBUG
|
||||
if (exception->value().is_object() && exception->value().as_object().is_error()) {
|
||||
if (should_log_exceptions() && exception->value().is_object() && exception->value().as_object().is_error()) {
|
||||
auto& error = static_cast<Error&>(exception->value().as_object());
|
||||
dbgln("Throwing JavaScript Error: {}, {}", error.name(), error.message());
|
||||
|
||||
@@ -276,7 +275,7 @@ void VM::throw_exception(Exception* exception)
|
||||
dbgln(" {}", function_name);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
m_exception = exception;
|
||||
unwind(ScopeType::Try);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user