[webkit-dev] How to handle error response on the browser when the HTTP request fails
julien.chaffraix at gmail.com
Thu Feb 12 09:34:18 PST 2009
> Thanks for your suggestion. I added delegate method in
> FrameloaderClient::dispatchDidFailLoading for GTK, however,
> noticed that the control flow never reached there - either in case of
> successful response or for http error like server not found etc.
> Then I added some debug code in FrameloaderClient::dispatchDidFailLoading
> for GTK; and found that the control flow does not reach there.
This is normal. The http connection did not fail : you send your
request and received your response correctly. If you had a DNS error,
some network hazard or anything that made your connection to the
server truly fail then it would be called.
If you want to catch an http error code, you should have a look at
FrameLoaderClient::dispatchDidReceiveResponse. You can then query the
Response about its details (httpStatusCode is likely your friend
More information about the webkit-dev