Skip to content

Commit 0ac2e6f

Browse files
authored
Merge pull request #1245 from LibertyGlobal/suresh/ONEM-33162_jsLogs_upstream
loading failure logs are not seen in systemconsole(journalctl)
2 parents 42103c1 + 0819c22 commit 0ac2e6f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

286290
void 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

325330
bool 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

638645
void WebFrameLoaderClient::dispatchDidFinishDocumentLoad()

0 commit comments

Comments
 (0)