[webkit-dev] How to handle error response on the browser when the HTTP request fails

Kulanthaivel kulanth at gmail.com
Mon Feb 16 06:19:18 PST 2009


Hi,
If you are using CURL then check the implementation
of WebCore\platform\network\curl\ResourceHandleManager.cpp. You can check
the callbacks headerCallback() writeCallback() which are used to pass the
header and data information from CURL to WebCore.
The ResourceHandleManager::downloadTimerCallback() will get called whenever
the download timer gets fired. Inside this function each CURL session is
processed and the result is passed back to WebCore whenever a particular
session is completed successfully or failed.
Regards
Kvel


On Mon, Feb 16, 2009 at 7:26 PM, Nitin Walke <nitwalke at gmail.com> wrote:

> Hi All,
>
> Thanks for your reply.I am totally new for the GtkWebkit.I tried to follow
> your suggestion but I am unable to achive my target.
> I get response in FrameLoaderClient::setMainDocumentError and
> FrameLoaderClient::shouldFallBack for the HTTP errorbut how to get actual
> error message from ResourceError that I don't know.Can I get exact steps to
> get the error like changes in the files and build the webkit,gtk  etc.
>
> Thanks & Regards,
> Nitin
>
>
> On Fri, Feb 13, 2009 at 10:50 AM, zaheer ahmad <zaheer.mot at gmail.com>wrote:
>
>> I think you need to set CURLOPT_FAILONERROR on the curl handle for the
>> curl to report http errors. Also in general you would want to diffferentiate
>> how you handle errors on mainresource vs subresources
>>
>> regards,
>> Zaheer
>>
>>
>> On Thu, Feb 12, 2009 at 9:04 PM, Nitin Walke <nitwalke at gmail.com> wrote:
>>
>>> Hi,
>>>
>>> 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.
>>>
>>> Am I missing something here? Your inputs will be appreciated.
>>>
>>> Regards,
>>> Nitin
>>>
>>>
>>> On Thu, Feb 12, 2009 at 11:55 AM, zaheer ahmad <zaheer.mot at gmail.com>wrote:
>>>
>>>> If you are using curl backend, network errors are already reported back
>>>> but ignored. you need to implement FrameloaderClient::dispatchDidFailLoading
>>>> delegate to pass it back to the application.
>>>>
>>>> regards,
>>>> Zaheer
>>>>
>>>>
>>>> On Wed, Feb 11, 2009 at 7:03 PM, Nitin Walke <nitwalke at gmail.com>wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am new to Webkit and have developed a basic browser using Webkit GTK
>>>>> port on linux.
>>>>> I want to show error response on the browser when the HTTP request
>>>>> fails for some reason like
>>>>> bad gateway or Server error etc. Currently the browser does not show
>>>>> any response in case of any error.
>>>>> Please advise how to go about implementing the same.
>>>>>
>>>>> Thanks
>>>>>
>>>>> _______________________________________________
>>>>> webkit-dev mailing list
>>>>> webkit-dev at lists.webkit.org
>>>>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>>>>>
>>>>>
>>>>
>>>
>>
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090216/2861812c/attachment.html>


More information about the webkit-dev mailing list