зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1734573 - Call errorCheck after onStartRequest, r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D132358
This commit is contained in:
Родитель
0d043867db
Коммит
84ce7c5e68
|
@ -744,11 +744,12 @@ HttpObserverManager = {
|
|||
lastActivity &&
|
||||
lastActivity !== this.GOOD_LAST_ACTIVITY
|
||||
) {
|
||||
// Make a trip through the event loop to make sure errors have a
|
||||
// chance to be processed before we fall back to a generic error
|
||||
// string.
|
||||
Services.tm.dispatchToMainThread(() => {
|
||||
channel.errorCheck();
|
||||
// Since the channel's security info is assigned in onStartRequest and
|
||||
// errorCheck is called in ChannelWrapper::onStartRequest, we should check
|
||||
// the errorString after onStartRequest to make sure errors have a chance
|
||||
// to be processed before we fall back to a generic error string.
|
||||
let onStart = function() {
|
||||
channel.removeEventListener("start", onStart);
|
||||
if (!channel.errorString) {
|
||||
this.runChannelListener(channel, "onErrorOccurred", {
|
||||
error:
|
||||
|
@ -756,7 +757,8 @@ HttpObserverManager = {
|
|||
`NS_ERROR_NET_UNKNOWN_${lastActivity}`,
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
channel.addEventListener("start", onStart);
|
||||
} else if (
|
||||
lastActivity !== this.GOOD_LAST_ACTIVITY &&
|
||||
lastActivity !==
|
||||
|
|
Загрузка…
Ссылка в новой задаче