ladybird/Userland/Libraries/LibWeb/HTML/Scripting/ExceptionReporter.h
Andreas Kling 4db5406d62 LibWeb: Support passing more parameter types to HTML::report_exception()
We now allow any JS::ThrowCompletion<T>, as well as JS::Completion
directly (although we'll VERIFY() that it's a throw completion.)
2022-02-08 17:47:44 +00:00

22 lines
411 B
C++

/*
* Copyright (c) 2022, David Tuin <davidot@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibJS/Forward.h>
namespace Web::HTML {
void report_exception(JS::Completion const&);
template<typename T>
inline void report_exception(JS::ThrowCompletionOr<T> const& result)
{
VERIFY(result.is_throw_completion());
report_exception(result.throw_completion());
}
}