mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 912699 - improve load source error messages; r=past
This commit is contained in:
parent
10aec2ea5b
commit
b55c712644
@ -1122,7 +1122,7 @@ SourceScripts.prototype = {
|
||||
window.clearTimeout(fetchTimeout);
|
||||
}
|
||||
if (aResponse.error) {
|
||||
deferred.reject([aSource, aResponse.message]);
|
||||
deferred.reject([aSource, aResponse.message || aResponse.error]);
|
||||
} else {
|
||||
deferred.resolve([aSource, aResponse.source]);
|
||||
}
|
||||
|
@ -3731,7 +3731,10 @@ function fetch(aURL, aOptions={ loadFromCache: true }) {
|
||||
try {
|
||||
NetUtil.asyncFetch(url, function onFetch(aStream, aStatus, aRequest) {
|
||||
if (!Components.isSuccessCode(aStatus)) {
|
||||
deferred.reject(new Error("Request failed: " + url));
|
||||
deferred.reject(new Error("Request failed with status code = "
|
||||
+ aStatus
|
||||
+ " after NetUtil.asyncFetch for url = "
|
||||
+ url));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3741,7 +3744,7 @@ function fetch(aURL, aOptions={ loadFromCache: true }) {
|
||||
aStream.close();
|
||||
});
|
||||
} catch (ex) {
|
||||
deferred.reject(new Error("Request failed: " + url));
|
||||
deferred.reject(ex);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -3759,7 +3762,10 @@ function fetch(aURL, aOptions={ loadFromCache: true }) {
|
||||
let streamListener = {
|
||||
onStartRequest: function(aRequest, aContext, aStatusCode) {
|
||||
if (!Components.isSuccessCode(aStatusCode)) {
|
||||
deferred.reject(new Error("Request failed: " + url));
|
||||
deferred.reject(new Error("Request failed with status code = "
|
||||
+ aStatusCode
|
||||
+ " in onStartRequest handler for url = "
|
||||
+ url));
|
||||
}
|
||||
},
|
||||
onDataAvailable: function(aRequest, aContext, aStream, aOffset, aCount) {
|
||||
@ -3767,7 +3773,10 @@ function fetch(aURL, aOptions={ loadFromCache: true }) {
|
||||
},
|
||||
onStopRequest: function(aRequest, aContext, aStatusCode) {
|
||||
if (!Components.isSuccessCode(aStatusCode)) {
|
||||
deferred.reject(new Error("Request failed: " + url));
|
||||
deferred.reject(new Error("Request failed with status code = "
|
||||
+ aStatusCode
|
||||
+ " in onStopRequest handler for url = "
|
||||
+ url));
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user