mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 21:24:09 +00:00
parent
83948f5882
commit
d1c4297802
1 changed files with 12 additions and 3 deletions
|
@ -2308,9 +2308,12 @@ Phaser.Loader.prototype = {
|
|||
xhr.onload = function () {
|
||||
|
||||
try {
|
||||
|
||||
if (xhr.readyState == 4 && xhr.status >= 400 && xhr.status <= 599) { // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called.
|
||||
return onerror.call(_this, file, xhr);
|
||||
}
|
||||
else {
|
||||
return onload.call(_this, file, xhr);
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
// If this was the last file in the queue and an error is thrown in the create method
|
||||
|
@ -2419,6 +2422,12 @@ Phaser.Loader.prototype = {
|
|||
|
||||
xhr.onload = function () {
|
||||
try {
|
||||
if (xhr.readyState == 4 && xhr.status >= 400 && xhr.status <= 599) { // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called.
|
||||
return onerror.call(_this, file, xhr);
|
||||
}
|
||||
else {
|
||||
return onload.call(_this, file, xhr);
|
||||
}
|
||||
return onload.call(_this, file, xhr);
|
||||
} catch (e) {
|
||||
_this.asyncComplete(file, e.message || 'Exception');
|
||||
|
|
Loading…
Reference in a new issue