Kevin revived this issue (actually 279) on the mailing list. My personal opinion is that we shouldn't do this in DWR. Why bloat the DWR code base when this can be handled well by the user. Here is an example of what I am talking about:
function getDataFromServer() {
dwrService.getAddress({
callback: getDataFromServerCallBack,
errorHandler: function(message, exc) {
handleError({
callLevelFunction: handleCallError,
callLevelFunctionArgs: ["test"],
message: message,
exception: exc
})
}
});
}
// Re-usable "global" error handle.
function handleError(argObject) {
// Retrieve the local call function and execute it.
var callLevelFunctionToExecute = argObject.callLevelFunction;
callLevelFunctionToExecute.apply(this, argObject.callLevelFunctionArgs);
// Now write the code that will apply to all errors here.
alert("global - do whatever here.");
}
// Handle a specific calls error
function handleCallError(args) {
alert(dwr.util.toDescriptiveString(args));
}
Attaching patch