K
kj
Hi. I'm *very* new to AJAX/AXAH, so please forgive me if the
following question sounds too stupid...
I'm in the process of designing the general error handling scheme
for a site that uses a fair bit of XHR-based communication with
its server. So I would like to know the various categories of
errors I can have, and to come up with the corresponding error
messages so that they are most helpful to the user.
I imagine that the most fundamental error that the application
could detect upon issuing an XHR would occur if the client machine
suddenly lost its connection to the network.
Next to that would be some DNS-type error that suddenly prevented
the client from finding the server ("server not found").
The next level of error would be when the server just fails to
respond at all (server down).
How can the client-side JavaScript code most easily distinguish
between those three possibilities?
Thanks!
Kynn
P.S. I realize that there are more types of errors possible beyond
the ones listed above, but once the server is able to respond then
the client program can rely on it to determine the nature of the
problem. The problem with the errors listed above is that the
client cannot use information from the server to disambiguate them.
following question sounds too stupid...
I'm in the process of designing the general error handling scheme
for a site that uses a fair bit of XHR-based communication with
its server. So I would like to know the various categories of
errors I can have, and to come up with the corresponding error
messages so that they are most helpful to the user.
I imagine that the most fundamental error that the application
could detect upon issuing an XHR would occur if the client machine
suddenly lost its connection to the network.
Next to that would be some DNS-type error that suddenly prevented
the client from finding the server ("server not found").
The next level of error would be when the server just fails to
respond at all (server down).
How can the client-side JavaScript code most easily distinguish
between those three possibilities?
Thanks!
Kynn
P.S. I realize that there are more types of errors possible beyond
the ones listed above, but once the server is able to respond then
the client program can rely on it to determine the nature of the
problem. The problem with the errors listed above is that the
client cannot use information from the server to disambiguate them.