Better XHR error handling

This commit is contained in:
copy 2013-11-07 21:27:18 +01:00
parent bde9c7d491
commit cdc52d7841

View file

@ -76,10 +76,16 @@ function dump_file(ab, name)
http.onload = function(e)
{
//if(http.readyState === 4 && http.status === 200)
if(http.response)
if(http.readyState === 4)
{
done(http.response);
if(http.status !== 200)
{
log("Loading the image failed");
}
else if(http.response)
{
done(http.response);
}
}
};