/* * Copyright (c) 2022, David Tuin * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include namespace Web::HTML { enum class ErrorInPromise { No, Yes, }; void report_exception_to_console(JS::Value, JS::Realm&, ErrorInPromise); void report_exception(JS::Completion const&, JS::Realm&); template inline void report_exception(JS::ThrowCompletionOr const& result, JS::Realm& realm) { VERIFY(result.is_throw_completion()); report_exception(result.throw_completion(), realm); } }