mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 20:28:11 +00:00
LibCore: Add support for LocalServer to propogate accept() errors
We still log the error (perhaps in the future, we will only want to log the error if there is no handler). But this allows callers to actually handle errors to e.g. unblock waiters.
This commit is contained in:
parent
3994a79718
commit
a4fc7dbf6d
2 changed files with 4 additions and 1 deletions
|
@ -54,7 +54,9 @@ void LocalServer::setup_notifier()
|
|||
if (on_accept) {
|
||||
auto maybe_client_socket = accept();
|
||||
if (maybe_client_socket.is_error()) {
|
||||
dbgln("LocalServer::on_ready_to_read: Error accepting a connection: {} (FIXME: should propagate!)", maybe_client_socket.error());
|
||||
dbgln("LocalServer::on_ready_to_read: Error accepting a connection: {}", maybe_client_socket.error());
|
||||
if (on_accept_error)
|
||||
on_accept_error(maybe_client_socket.release_error());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue