mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:27:35 +00:00
LibWeb: Add a method to ExceptionOr to drop error handling
This should solely be used to to ignore errors in infallible contexts.
This commit is contained in:
parent
3a01573350
commit
411097002b
1 changed files with 6 additions and 0 deletions
|
@ -110,6 +110,12 @@ public:
|
|||
return !m_exception.template has<Empty>();
|
||||
}
|
||||
|
||||
ValueType release_value_but_fixme_should_propagate_errors()
|
||||
{
|
||||
VERIFY(!is_error());
|
||||
return release_value();
|
||||
}
|
||||
|
||||
// These are for compatibility with the TRY() macro in AK.
|
||||
[[nodiscard]] bool is_error() const { return is_exception(); }
|
||||
Variant<SimpleException, JS::NonnullGCPtr<DOMException>, JS::Completion> release_error() { return exception(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue