summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/Scripting/ExceptionReporter.h
blob: dc4aad44c8aa2dde23dd7af2376d2ea6347f79cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * 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());
}

}