Opened 10 years ago

Closed 10 years ago

#16023 closed defect (fixed)

xhr RequestError breaks back-compat

Reported by: Adam Peller Owned by: Bryan Forbes
Priority: undecided Milestone: 1.8.1
Component: IO Version: 1.8.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by Adam Peller)

Prior to Dojo 1.8, xhr would throw an Error on xhr failure as so:

                        var err = new Error("Unable to load " + dfd.ioArgs.url \
+ " status:" + xhr.status);
                        err.status = xhr.status;
                        err.responseText = xhr.responseText;
                        err.xhr = xhr;

In 1.8, a RequestError? object is thrown with only message and response. The response object then has the status information.

It may not be reasonable to expect full back-compat (e.g. the exception type change, and perhaps passing back the xhr object would be a problem) but it's important to keep the status code in the same place, since that's often critical to how errors are handled, and prior to 1.8, that was the only way to reliably get that information.

Change History (4)

comment:1 Changed 10 years ago by Adam Peller

Description: modified (diff)
Milestone: tbd1.8.1
Status: newassigned

comment:2 Changed 10 years ago by Bryan Forbes

In [29708]:

Added back-compat properties to errors. refs #16023 !strict

comment:3 Changed 10 years ago by Bryan Forbes

In [29709]:

Added back-compat properties to errors (1.8 backport). refs #16023 !strict

comment:4 Changed 10 years ago by Bryan Forbes

Resolution: fixed
Status: assignedclosed

I changed the back-compat layer for XHR to add those properties to the error.

Note: See TracTickets for help on using tickets.