mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibJS: Log when we throw a JavaScript Error
This makes debugging a lot easier since we actually learn that an Error got thrown.
This commit is contained in:
parent
9b0bfcb8b7
commit
eabdbe0ee9
Notes:
sideshowbarker
2024-07-19 07:55:46 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/eabdbe0ee9d
1 changed files with 4 additions and 0 deletions
|
@ -206,6 +206,10 @@ Value Interpreter::call(Function* function, Value this_value, const Vector<Value
|
|||
|
||||
Value Interpreter::throw_exception(Exception* exception)
|
||||
{
|
||||
if (exception->value().is_object() && exception->value().as_object().is_error()) {
|
||||
auto& error = static_cast<Error&>(exception->value().as_object());
|
||||
dbg() << "Throwing JavaScript Error: " << error.name() << ", " << error.message();
|
||||
}
|
||||
m_exception = exception;
|
||||
unwind(ScopeType::Try);
|
||||
return {};
|
||||
|
|
Loading…
Add table
Reference in a new issue