mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-06 21:45:29 +00:00
Kernel: Make DoubleBuffer::try() return KResultOr
This tidies up error propagation in a number of places.
This commit is contained in:
@@ -97,10 +97,10 @@ RefPtr<TCPSocket> TCPSocket::create_client(const IPv4Address& new_local_address,
|
||||
if (table.contains(tuple))
|
||||
return {};
|
||||
|
||||
auto receive_buffer = create_receive_buffer();
|
||||
if (!receive_buffer)
|
||||
auto receive_buffer = try_create_receive_buffer();
|
||||
if (receive_buffer.is_error())
|
||||
return {};
|
||||
auto client_or_error = TCPSocket::try_create(protocol(), receive_buffer.release_nonnull());
|
||||
auto client_or_error = TCPSocket::try_create(protocol(), receive_buffer.release_value());
|
||||
if (client_or_error.is_error())
|
||||
return {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user