@@ -293,6 +293,16 @@ void WebLocalFrameLoaderClient::dispatchDidReceiveResponse(DocumentLoader*, Reso
293293#if PLATFORM(GTK) || PLATFORM(WPE)
294294 webPage->send (Messages::WebPageProxy::DidReceiveResponseForResource (identifier, m_frame->frameID (), response));
295295#endif
296+
297+ if (response.httpStatusCode () >= 400 ) {
298+ StringBuilder message;
299+ message.append (" Failed to load resource: the server responded with a status of " _s);
300+ message.append (String::number (response.httpStatusCode ()));
301+ message.append (" (" _s);
302+ message.append (response.httpStatusText ());
303+ message.append (" )" _s);
304+ LOG (Loading," dispatchDidReceiveResponse->message:%s" , message.toString ().utf8 ().data ());
305+ }
296306}
297307
298308void WebLocalFrameLoaderClient::dispatchDidReceiveContentLength (DocumentLoader*, ResourceLoaderIdentifier identifier, int dataLength)
@@ -342,6 +352,8 @@ void WebLocalFrameLoaderClient::dispatchDidFailLoading(DocumentLoader*, Resource
342352#endif
343353
344354 webPage->removeResourceRequest (identifier);
355+
356+ LOG (Loading," dispatchedDidFailLoading: isTimeout=%d, isCancellation=%d, isAccessControl=%d, errorCode=%d description:%s" , error.isTimeout (), error.isCancellation (), error.isAccessControl (), error.errorCode (), error.localizedDescription ().utf8 ().data ());
345357}
346358
347359bool WebLocalFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache (DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int /* length*/ )
@@ -713,6 +725,8 @@ void WebLocalFrameLoaderClient::dispatchDidFailLoad(const ResourceError& error)
713725 // If we have a load listener, notify it.
714726 if (LoadListener* loadListener = m_frame->loadListener ())
715727 loadListener->didFailLoad (m_frame.ptr (), error.isCancellation ());
728+
729+ LOG (Loading," dispatchDidFailLoad: isTimeout= %d, isCancellation= %d, isAccessControl= %d, errorCode= %d description: %s" , error.isTimeout (), error.isCancellation (), error.isAccessControl (), error.errorCode (), error.localizedDescription ().utf8 ().data ());
716730}
717731
718732void WebLocalFrameLoaderClient::dispatchDidFinishDocumentLoad ()
0 commit comments