mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
WebContent+LibWeb+LibJS: Report exceptions to the JS console
Print exceptions passed to `HTML::report_exception` in the JS console Refactored `ExceptionReporter`: in order to report exception now you need to pass the relevant realm in it. For passed `JS::Value` we now create `JS::Error` object to print value as the error message.
This commit is contained in:
parent
2eb6dbd4f0
commit
40aad77ab1
14 changed files with 86 additions and 58 deletions
|
@ -453,6 +453,12 @@ void Console::output_debug_message([[maybe_unused]] LogLevel log_level, [[maybe_
|
|||
#endif
|
||||
}
|
||||
|
||||
void Console::report_exception(JS::Error const& exception, bool in_promise) const
|
||||
{
|
||||
if (m_client)
|
||||
m_client->report_exception(exception, in_promise);
|
||||
}
|
||||
|
||||
ThrowCompletionOr<String> Console::value_vector_to_string(MarkedVector<Value> const& values)
|
||||
{
|
||||
auto& vm = realm().vm();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue