mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +00:00
LibWeb+LibRequests+RequestServer: Report network error on request finish
This allows us to bubble up network errors to API consumers after finishing a request.
This commit is contained in:
parent
9e2b70661e
commit
ff18114ae7
Notes:
github-actions[bot]
2024-10-10 18:57:15 +00:00
Author: https://github.com/rmg-x
Commit: ff18114ae7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1638
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/alimpfard
9 changed files with 115 additions and 23 deletions
|
@ -68,11 +68,11 @@ bool RequestClient::set_certificate(Badge<Request>, Request& request, ByteString
|
|||
return IPCProxy::set_certificate(request.id(), move(certificate), move(key));
|
||||
}
|
||||
|
||||
void RequestClient::request_finished(i32 request_id, bool success, u64 total_size)
|
||||
void RequestClient::request_finished(i32 request_id, u64 total_size, Optional<NetworkError> const& network_error)
|
||||
{
|
||||
RefPtr<Request> request;
|
||||
if ((request = m_requests.get(request_id).value_or(nullptr))) {
|
||||
request->did_finish({}, success, total_size);
|
||||
request->did_finish({}, total_size, network_error);
|
||||
}
|
||||
m_requests.remove(request_id);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue