Given this little snippet of code:
function getPage () {
var xhttp = new XMLHttpRequest();
xhttp.addEventListener("error", getFailed);
xhttp.open("GET", "http://nonexistentserver.com", true);
xhttp.send();
}
function getFailed(msg) {
// I get an ProgressEvent object which doesn't have any text properties?
}
When it runs, the getFailed() callback does indeed get called, but I can't find any information on how to determine what the error was. When I searched for information, all I could find were HTML errors (like 404) and bug reports about causing an error. How do I obtain information about what the failure was available in the error callback?