mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +00:00
LibWeb: Use specific error classes when throwing exceptions
Generally: - interpreter.throw_exception<JS::Error>("TypeError", "Message"); + interpreter.throw_exception<JS::TypeError>("Message");
This commit is contained in:
parent
ad230e8839
commit
62d0fa5af8
3 changed files with 6 additions and 6 deletions
|
@ -64,7 +64,7 @@ static Document* document_from(JS::Interpreter& interpreter)
|
|||
if (!this_object)
|
||||
return {};
|
||||
if (StringView("DocumentWrapper") != this_object->class_name()) {
|
||||
interpreter.throw_exception<JS::Error>("TypeError", "That's not a DocumentWrapper, bro.");
|
||||
interpreter.throw_exception<JS::TypeError>("That's not a DocumentWrapper, bro.");
|
||||
return {};
|
||||
}
|
||||
return &static_cast<DocumentWrapper*>(this_object)->node();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue