I use XMLHttpRequest class to send payload data from web client to web server.
I want to handle errors such as follows...
- REQUEST TIMEOUT (CONNECTION TIMEOUT)
- 500, INTERNAL SERVER ERROR
- 502, BAD GATEWAY
- 503, SERVICE UNAVAILABLE
I do not know the obvious usage of onstatechange, onerror, ontimeout properties. I do not know if onreadystatechange alone can catch those errors.
Also, if I have to use onerror, ontimeout, I want to know what is the difference with onreadystatechange.