mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 14:47: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
|
@ -9,6 +9,7 @@
|
|||
#include <AK/HashTable.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Runtime/Error.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
|
@ -16,7 +17,7 @@ class MarkupGenerator {
|
|||
public:
|
||||
static String html_from_source(StringView);
|
||||
static String html_from_value(Value);
|
||||
static String html_from_error(Object&);
|
||||
static String html_from_error(Error const&, bool);
|
||||
|
||||
private:
|
||||
enum class StyleType {
|
||||
|
@ -37,7 +38,8 @@ private:
|
|||
static void object_to_html(Object const&, StringBuilder& output_html, HashTable<Object*>&);
|
||||
static void function_to_html(Object const&, StringBuilder& output_html, HashTable<Object*>&);
|
||||
static void date_to_html(Object const&, StringBuilder& output_html, HashTable<Object*>&);
|
||||
static void error_to_html(Object const&, StringBuilder& output_html, HashTable<Object*>&);
|
||||
static void error_to_html(Error const&, StringBuilder& output_html, bool in_promise);
|
||||
static void trace_to_html(TracebackFrame const&, StringBuilder& output_html);
|
||||
|
||||
static String style_from_style_type(StyleType);
|
||||
static StyleType style_type_for_token(Token);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue