Opened 8 years ago
Closed 8 years ago
#17128 closed defect (invalid)
dojo/request cannot access response on error
Reported by: | Wouter Hager | Owned by: | Bryan Forbes |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | IO | Version: | 1.9.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
When the response for a request has an error header, I cannot access it's properties.
Change History (4)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
Component: | Core → IO |
---|---|
Owner: | set to Bryan Forbes |
OK, sounds like this should be closed as invalid but maybe Bryan wants to update the docs.
comment:3 Changed 8 years ago by
edit : please ignore, im actually looking for a way to do this with request/registry which I'll raise a separate bug against
comment:4 Changed 8 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
When the error handler is invoked, it is passed an error object that has a response
property:
request(url).then( function (data) { // good response }, function (error) { console.error('An error has occurred. Error code: ' + error.response.status); } );
Note: See
TracTickets for help on using
tickets.
I see now in the code that the response is returned as a property of the error. Not clear from the docs though.