Regarding IWebResp | developer.brewmp.com Regarding IWebResp | developer.brewmp.com

Developer

Regarding IWebResp

Forums:

Hi
Friends

I would like to ask you a question that whenever a web application tries to access a web page using IWeb and IWebResp interfacaces , usually nCode in WebRespInfo contains value between 200 and 300. sometimes it happens that nCode in WebRespInfo structure has the negative value (Most probably: -1295). What could be the possible reasons that could lead to the generation of negative value.

As per the documentation for WebRespInfo, any non-protocol errors are returned as negative codes.
These errors are all defined in AEEError.h under WEB_ERROR_BASE. For example, WEB_ERROR_DNSCONFIG.

As per the documentation for WebRespInfo, any non-protocol errors are returned as negative codes.
These errors are all defined in AEEError.h under WEB_ERROR_BASE. For example, WEB_ERROR_DNSCONFIG.

BenBlaukopf wrote:As per the documentation for WebRespInfo, any non-protocol errors are returned as negative codes.
These errors are all defined in AEEError.h under WEB_ERROR_BASE. For example, WEB_ERROR_DNSCONFIG.
Thanks For replying.
I 've gone through the AEError.h and AEENetErr.h header files. There is decription of large no. of network errors that can be arisen during the course of execution of app. I think they 're more than 40. Do i need to handle all the 40 cases to get the exact details of the error.
Also in case i want to avoid the condition which i causing those errors then what changes do i 've to make in my app?

BenBlaukopf wrote:As per the documentation for WebRespInfo, any non-protocol errors are returned as negative codes.
These errors are all defined in AEEError.h under WEB_ERROR_BASE. For example, WEB_ERROR_DNSCONFIG.
Thanks For replying.
I 've gone through the AEError.h and AEENetErr.h header files. There is decription of large no. of network errors that can be arisen during the course of execution of app. I think they 're more than 40. Do i need to handle all the 40 cases to get the exact details of the error.
Also in case i want to avoid the condition which i causing those errors then what changes do i 've to make in my app?

I would have thought you'd end up with something like
server_error: notify user to try later
auth failure: ask user for password
most other errors: try later on a back-off scheme.
anything permanent: give up
That's not going to result in 40 different case statements unless you really have 40 different potential courses of action.
You'll never be able to write your app so you get no errors, as they are largely due to conditions outside your control, e.g. DNS failures.

I would have thought you'd end up with something like
server_error: notify user to try later
auth failure: ask user for password
most other errors: try later on a back-off scheme.
anything permanent: give up
That's not going to result in 40 different case statements unless you really have 40 different potential courses of action.
You'll never be able to write your app so you get no errors, as they are largely due to conditions outside your control, e.g. DNS failures.

Yes as BenBlaukopf said, group down the errors into well defined categories like
1) Network Errors - negative response code, ie unable to establish the connection
Ask the user to check if he has network coverage / data access plans.
2) Content not available - 404 error, etc.
Show up an error mentioning that the requested content is not accessible.
3) Server Error - any error received from the server, ie not between 200 and 300.
Show up an error mentioning that the Server is not available and ask the user to try again later.
and so on.
In most cases it is not required to handle all the error types separately, but generalize them as needed.

Yes as BenBlaukopf said, group down the errors into well defined categories like
1) Network Errors - negative response code, ie unable to establish the connection
Ask the user to check if he has network coverage / data access plans.
2) Content not available - 404 error, etc.
Show up an error mentioning that the requested content is not accessible.
3) Server Error - any error received from the server, ie not between 200 and 300.
Show up an error mentioning that the Server is not available and ask the user to try again later.
and so on.
In most cases it is not required to handle all the error types separately, but generalize them as needed.

Thanks
BenBlaukopf
RDRP
for replying.
I would try the same.

Thanks
BenBlaukopf
RDRP
for replying.
I would try the same.