Ticket #2680 (closed enhancement: fixed)
dojo.io.bind error handling model needs change
| Reported by: | tjerk@… | Owned by: | alex |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.2 |
| Component: | IO | Version: | 0.4.2 |
| Severity: | major | Keywords: | dojo bind ajax error handling |
| Cc: |
Description (last modified by jburke) (diff)
One calls dojo.io.bind with an object argument that defines a load and error function.
Now when the load function throws an error dojo sees this as a failed AjaxRequest? and calls the error function.
Dojo should treat errors thrown in the load function as normal program errors and it should not catch this error.
Example code:
dojo.io.bind({
url: action,
encoding: "utf-8",
load: function(type, data, e) {
throw "SomeError";
},
error: function(type, error) {
alert(error.message);
}
mimetype: "text/xml"
});
The error thrown in load is catched and the error function is called.
I think it should report the error to the browser. ( thus not catch it ). This is better because now we can do some debugging if some unespected error occured in a load function.
PS: In previous versions of dojo I had no problems
Change History
Note: See
TracTickets for help on using
tickets.