summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorKarol Baraniecki <karol@baraniecki.eu>2023-03-07 14:36:40 +0100
committerLinus Groh <mail@linusgroh.de>2023-03-09 12:59:57 +0000
commitcd4804ed1caccbc097595ded31a4e2a7740d38fe (patch)
tree1361462d7dad34a70db038dbe81d543b50547f8a /Userland/Libraries/LibWeb
parentf8e94f286280c4c6ed05c5490a7f55773adc491b (diff)
downloadserenity-cd4804ed1caccbc097595ded31a4e2a7740d38fe.zip
LibWeb: Use fallible version of StringBuilder::to_byte_buffer
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/WebDriver/Client.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/WebDriver/Client.cpp b/Userland/Libraries/LibWeb/WebDriver/Client.cpp
index 135523651e..70c3bdd3d3 100644
--- a/Userland/Libraries/LibWeb/WebDriver/Client.cpp
+++ b/Userland/Libraries/LibWeb/WebDriver/Client.cpp
@@ -220,7 +220,7 @@ ErrorOr<void, Client::WrappedError> Client::on_ready_to_read()
break;
}
- m_request = HTTP::HttpRequest::from_raw_request(builder.to_byte_buffer());
+ m_request = HTTP::HttpRequest::from_raw_request(TRY(builder.try_to_byte_buffer()));
if (!m_request.has_value())
return {};
@@ -278,7 +278,7 @@ ErrorOr<void, Client::WrappedError> Client::send_success_response(JsonValue resu
builder.appendff("Content-Length: {}\r\n", content.length());
builder.append("\r\n"sv);
- auto builder_contents = builder.to_byte_buffer();
+ auto builder_contents = TRY(builder.try_to_byte_buffer());
TRY(m_socket->write(builder_contents));
while (!content.is_empty()) {
@@ -319,8 +319,8 @@ ErrorOr<void, Client::WrappedError> Client::send_error_response(Error const& err
header_builder.appendff("Content-Length: {}\r\n", content_builder.length());
header_builder.append("\r\n"sv);
- TRY(m_socket->write(header_builder.to_byte_buffer()));
- TRY(m_socket->write(content_builder.to_byte_buffer()));
+ TRY(m_socket->write(TRY(header_builder.try_to_byte_buffer())));
+ TRY(m_socket->write(TRY(content_builder.try_to_byte_buffer())));
log_response(error.http_status);
return {};