1
Fork 0
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:
Linus Groh 2020-04-12 19:32:35 +01:00 committed by Andreas Kling
parent ad230e8839
commit 62d0fa5af8
3 changed files with 6 additions and 6 deletions

View file

@ -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();