ExceptionReporter.h 411 B

12345678910111213141516171819202122
  1. /*
  2. * Copyright (c) 2022, David Tuin <davidot@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibJS/Forward.h>
  8. namespace Web::HTML {
  9. void report_exception(JS::Completion const&);
  10. template<typename T>
  11. inline void report_exception(JS::ThrowCompletionOr<T> const& result)
  12. {
  13. VERIFY(result.is_throw_completion());
  14. report_exception(result.throw_completion());
  15. }
  16. }