Opened 10 years ago
Closed 10 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: |
Description
Hi,
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.
Thanks
Change History (2)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Milestone: | tbd → 1.4 |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
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.
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.