mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 21:26:22 +00:00
AK: VERIFY inside release_value_but_fixme_should_propagate_errors()
While the code did already VERIFY that the ErrorOr holds a value, this was done by Variant, so the error message was just that `has<T>()` is false. This is less helpful than I would like, especially if backtraces are not working and this is all you have to go on. Adding this extra VERIFY means the assertion message (`!is_error()`) is easier to understand.
This commit is contained in:
parent
decdd6b61a
commit
1a4dd47d5f
Notes:
sideshowbarker
2024-07-17 18:39:16 +09:00
Author: https://github.com/AtkinsSJ
Commit: 1a4dd47d5f
Pull-request: https://github.com/SerenityOS/serenity/pull/12317
Reviewed-by: https://github.com/sin-ack ✅
Reviewed-by: https://github.com/trflynn89
1 changed files with 5 additions and 1 deletions
|
@ -87,7 +87,11 @@ public:
|
||||||
T release_value() { return move(value()); }
|
T release_value() { return move(value()); }
|
||||||
ErrorType release_error() { return move(error()); }
|
ErrorType release_error() { return move(error()); }
|
||||||
|
|
||||||
T release_value_but_fixme_should_propagate_errors() { return release_value(); }
|
T release_value_but_fixme_should_propagate_errors()
|
||||||
|
{
|
||||||
|
VERIFY(!is_error());
|
||||||
|
return release_value();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// 'downcast' is fishy in this context. Let's hide it by making it private.
|
// 'downcast' is fishy in this context. Let's hide it by making it private.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue