diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/ExceptionReporter.cpp b/Userland/Libraries/LibWeb/HTML/Scripting/ExceptionReporter.cpp
index 8135cb98d9..c5e4802cdd 100644
--- a/Userland/Libraries/LibWeb/HTML/Scripting/ExceptionReporter.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Scripting/ExceptionReporter.cpp
@@ -12,12 +12,13 @@
namespace Web::HTML {
// https://html.spec.whatwg.org/#report-the-exception
-void report_exception(JS::ThrowCompletionOr const& result)
+void report_exception(JS::Completion const& throw_completion)
{
// FIXME: This is just old code, and does not strictly follow the spec of report an exception.
// FIXME: We should probably also report these exceptions to the JS console.
- VERIFY(result.throw_completion().value().has_value());
- auto thrown_value = *result.throw_completion().value();
+ VERIFY(throw_completion.type() == JS::Completion::Type::Throw);
+ VERIFY(throw_completion.value().has_value());
+ auto thrown_value = *throw_completion.value();
if (thrown_value.is_object()) {
auto& object = thrown_value.as_object();
auto& vm = object.vm();
diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/ExceptionReporter.h b/Userland/Libraries/LibWeb/HTML/Scripting/ExceptionReporter.h
index a931ca4575..dc4aad44c8 100644
--- a/Userland/Libraries/LibWeb/HTML/Scripting/ExceptionReporter.h
+++ b/Userland/Libraries/LibWeb/HTML/Scripting/ExceptionReporter.h
@@ -10,6 +10,13 @@
namespace Web::HTML {
-void report_exception(JS::ThrowCompletionOr const& value);
+void report_exception(JS::Completion const&);
+
+template
+inline void report_exception(JS::ThrowCompletionOr const& result)
+{
+ VERIFY(result.is_throw_completion());
+ report_exception(result.throw_completion());
+}
}