1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:38:11 +00:00

LibWeb: Make ResourceLoader pass body and headers in error callback

Pass body and headers of a failed request to callback so caller can
process them.
This commit is contained in:
Aliaksandr Kalenik 2023-10-02 19:19:26 +02:00 committed by Andreas Kling
parent 50350fb79c
commit b9e0ad4358
4 changed files with 20 additions and 16 deletions

View file

@ -1776,7 +1776,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> nonstandard_resource_load
// FIXME: Set response status message
pending_response->resolve(response);
},
[&vm, request, pending_response](auto& error, auto status_code) {
[&realm, &vm, request, pending_response](auto& error, auto status_code, auto, auto&) {
dbgln_if(WEB_FETCH_DEBUG, "Fetch: ResourceLoader load for '{}' failed: {} (status {})", request->url(), error, status_code.value_or(0));
auto response = Infrastructure::Response::create(vm);
// FIXME: This is ugly, ResourceLoader should tell us.