mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 23:57:25 +00:00
LibThreading+Everywhere: Support returning error from BackgroundAction
This patch allows returning an `Error` from the `on_complete` callback in `BackgroundAction`. It also adds a custom callback to manage errors returned during its execution.
This commit is contained in:
committed by
Linus Groh
parent
664117564a
commit
2693745336
@@ -120,10 +120,11 @@ void ThreadStackWidget::refresh()
|
||||
return Symbolication::symbolicate_thread(pid, tid, Symbolication::IncludeSourcePosition::No);
|
||||
},
|
||||
|
||||
[weak_this = make_weak_ptr()](auto result) {
|
||||
[weak_this = make_weak_ptr()](auto result) -> ErrorOr<void> {
|
||||
if (!weak_this)
|
||||
return;
|
||||
return {};
|
||||
Core::EventLoop::current().post_event(const_cast<Core::Object&>(*weak_this), make<CompletionEvent>(move(result)));
|
||||
return {};
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user