Opened 10 years ago
Closed 7 years ago
#16239 closed defect (wontfix)
xhr try/catch handler
Reported by: | prashantjain68 | Owned by: | Bryan Forbes |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | IO | Version: | 1.8.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
I am new to dojo and learning dojo the hard way which is debugging the source code.
One thing I noticed: All my errors originated from the xhr class (as per the Chrome console). In one case, my xhr call succeeded but still the error handler registered with xhr was called. After debugging, I realized that my callback was being invoked in a try/ catch block in the xhr class, line 432. The callback then executed another 5000 lines of code and if there is an error in one of them, the xhr calls the error handler or reports to the browser that an error occurred in xhr line 432. I am now putting break points at different places in those 5000 lines of code to see where the error is actually happening.
This is very mis-leading and a nightmare to debug. The load and error callback registered with xhr should not be called within a try/ catch.
Attachments (1)
Change History (3)
Changed 10 years ago by
Attachment: | Screen shot 2012-10-25 at 9.02.49 AM.png added |
---|
comment:1 Changed 10 years ago by
Component: | General → IO |
---|---|
Owner: | set to Bryan Forbes |
comment:2 Changed 7 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Given that dojo/_base/xhr has been deprecated in favor of dojo/request, I'm going to close this out.
Browser error and callstack