#8418 closed defect (fixed)
dojox.rpc.jsonrest does not pass return arguments in commit()'s error handler
Reported by: | John Locke | Owned by: | anonymous |
---|---|---|---|
Priority: | high | Milestone: | 1.3 |
Component: | General | Version: | 1.2.3 |
Keywords: | jsonreststore, jsonrest | Cc: | |
Blocked By: | Blocking: |
Description
Discovered when trying to trap an error being passed from the server to a dojox.data.JsonRestStore?, in response to a PUT.
When you call the JsonRestStore?.save() method and pass an onError function, that function does not receive any arguments.
Expected result: Should receive the error response from XHR.
Suggested patch:
--- a/dojox/rpc/JsonRest.js +++ b/dojox/rpc/JsonRest.js @@ -122,7 +122,7 @@ dojo.require("dojox.rpc.Rest"); jr.revert(); // revert if there was an e dirtyObjects = postCommitDirtyObjects; if(kwArgs.onError){ - kwArgs.onError(); + kwArgs.onError(arguments); } return value; });
Change History (3)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 Changed 12 years ago by
Milestone: | tbd → 1.3 |
---|
batch move of tickets marked 'tbd' fixed in the 1.3 timeframe
Note: See
TracTickets for help on using
tickets.
After testing the patch, kryszyp's version is better.
kwArgs.onError(arguments) passes an array with the first element set to the response object.
kwArgs.onError(value) works as expected, passing just the response object.