Commit 84ce7c5e authored by Kershaw Chang's avatar Kershaw Chang
Browse files

Bug 1734573 - Call errorCheck after onStartRequest, r=mixedpuppy

parent 0d043867
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -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 !==