Opened 12 years ago

Closed 12 years ago

#10053 closed defect (duplicate)

dojo.xhr canceller throws a spurious Error

Reported by: lipik Owned by: anonymous
Priority: high Milestone: 1.4
Component: Core Version: 1.3.2
Keywords: xhr, deferred, cancel Cc:
Blocked By: Blocking:



Cancelling an inflight request throws an Error - this is wrong, since the cancellation is not an error as such. The offending code is in dojo/_base/xhr.js, function _deferredCancel

The code should be changed to log a message to the console instead of throwing an Error. As it stands, cancelling an in-flight xhr request (maybe because it is no longer required) throws an exception - so a call to cancel always has to be wrapped in a try block.


Change History (2)

comment:1 Changed 12 years ago by lipik

OOps, I spoke without foolowing the code - the Error is not actually thrown, but written to the console as console.error. So, this is no so bad, only an irritation that even in release builds, console keeps showing errors where the app is working exactly as expected.

So, this is a low priority annoyance, rather than an error.

comment:2 Changed 12 years ago by James Burke

Milestone: tbd1.4
Resolution: duplicate
Status: newclosed

This is fixed in trunk/as part of 1.4, in that you can now pass failOk: true to the xhr call, and it will skip logging of the error.

Note: See TracTickets for help on using tickets.