Closed Bug 345899 Opened 18 years ago Closed 18 years ago

Protect against XMLHttpRequest statusText not being available

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.8.1beta2

People

(Reporter: robert.strong.bugs, Assigned: robert.strong.bugs)

Details

(Keywords: fixed1.8.1)

Attachments

(1 file)

When a network connection is unavailable we throw in the EM when getting the statusText from XMLHttpRequest. Patch coming up.
Attached patch patchSplinter Review
Simple fix. Without this we throw and STATUS_FAILURE is never returned for an add-on during an update check.
Attachment #230623 - Flags: review?(sspitzer)
Requesting blocking 2.0 - this can prevent the appearance of a hang during an update check when a network connection is unavailable.
Flags: blocking-firefox2?
shouldn't this be something like:

+    // this can fail when a network connection is not present.
+    var statusText;
+    try {
+      statusText = request.statusText;
+    }
+    catch (e) {
+      status = 0;
+    }
     // When status is 0 we don't have a valid channel.
     if (status == 0)
       statusText = "nsIXMLHttpRequest channel unavailable";
Comment on attachment 230623 [details] [diff] [review]
patch

r=sspitzer, my nit is my own js coding style, and does not match this file.
Attachment #230623 - Flags: review?(sspitzer) → review+
Checked in to trunk
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Flags: blocking-firefox2? → blocking-firefox2+
Comment on attachment 230623 [details] [diff] [review]
patch

Simple patch that adds a try catch around getting the XMLHttpRequest statusText property for the no network connection case where XMLHttpRequest will throw
Attachment #230623 - Flags: approval1.8.1?
Comment on attachment 230623 [details] [diff] [review]
patch

a=drivers. Please land this on the MOZILLA_1_8_BRANCH.
Attachment #230623 - Flags: approval1.8.1? → approval1.8.1+
Checked in to MOZILLA_1_8_BRANCH
Keywords: fixed1.8.1
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: