@@ -281,6 +281,10 @@ void WebFrameLoaderClient::dispatchDidReceiveResponse(DocumentLoader*, ResourceL
281281 return ;
282282
283283 webPage->injectedBundleResourceLoadClient ().didReceiveResponseForResource (*webPage, m_frame, identifier, response);
284+ if (response.httpStatusCode () >= 400 ) {
285+ String message = " Failed to load resource: the server responded with a status of " + String::number (response.httpStatusCode ()) + " (" + response.httpStatusText () + ' )' ;
286+ LOG (Loading," dispatchDidReceiveResponse->message:%s" , message.utf8 ().data ());
287+ }
284288}
285289
286290void WebFrameLoaderClient::dispatchDidReceiveContentLength (DocumentLoader*, ResourceLoaderIdentifier identifier, int dataLength)
@@ -320,6 +324,7 @@ void WebFrameLoaderClient::dispatchDidFailLoading(DocumentLoader*, ResourceLoade
320324
321325 webPage->injectedBundleResourceLoadClient ().didFailLoadForResource (*webPage, m_frame, identifier, error);
322326 webPage->removeResourceRequest (identifier);
327+ 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 ());
323328}
324329
325330bool WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache (DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int /* length*/ )
@@ -633,6 +638,8 @@ void WebFrameLoaderClient::dispatchDidFailLoad(const ResourceError& error)
633638 // If we have a load listener, notify it.
634639 if (WebFrame::LoadListener* loadListener = m_frame->loadListener ())
635640 loadListener->didFailLoad (m_frame.ptr (), error.isCancellation ());
641+
642+ 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 ());
636643}
637644
638645void WebFrameLoaderClient::dispatchDidFinishDocumentLoad ()
0 commit comments