mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
LibWeb: Log failed Fetch responses when WEB_FETCH_DEBUG is enabled
We do the same for successful responses. Very useful for debugging issues on live websites.
This commit is contained in:
parent
eb0d56a4ed
commit
7681772b9f
1 changed files with 2 additions and 0 deletions
|
@ -1779,6 +1779,8 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> nonstandard_resource_load
|
|||
},
|
||||
[&realm, &vm, request, pending_response](auto& error, auto status_code, auto data, auto& response_headers) {
|
||||
dbgln_if(WEB_FETCH_DEBUG, "Fetch: ResourceLoader load for '{}' failed: {} (status {})", request->url(), error, status_code.value_or(0));
|
||||
if constexpr (WEB_FETCH_DEBUG)
|
||||
log_response(status_code, response_headers, data);
|
||||
auto response = Infrastructure::Response::create(vm);
|
||||
// FIXME: This is ugly, ResourceLoader should tell us.
|
||||
if (status_code.value_or(0) == 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue