mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibCore: Allow Promise to be resolved if it has a non-Error error type
This commit is contained in:
parent
e24d1ee895
commit
592be4ecad
|
|
@ -29,7 +29,7 @@ public:
|
|||
virtual ~Promise() = default;
|
||||
static NonnullRefPtr<Promise> construct() { return adopt_ref(*new Promise()); }
|
||||
|
||||
Function<ErrorOr<void>(Result&)> on_resolution;
|
||||
Function<ErrorOr<void, TError>(Result&)> on_resolution;
|
||||
Function<void(ErrorType&)> on_rejection;
|
||||
|
||||
template<typename U>
|
||||
|
|
@ -168,7 +168,7 @@ public:
|
|||
|
||||
private:
|
||||
template<typename T>
|
||||
void possibly_handle_rejection(ErrorOr<T>& result)
|
||||
void possibly_handle_rejection(ErrorOr<T, TError>& result)
|
||||
{
|
||||
if (result.is_error() && on_rejection)
|
||||
on_rejection(result.error());
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user