DWR

Chaining support for error/exception/warning handlers

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: 4.0
  • Component/s: Engine
  • Description:
    This issue takes the chaining support from DWR-261 and adds it to the errorHandler, warningHandler and exceptionHandler instead of merely at the exceptionHandler.
  1. dwr-279.patch
    (2 kB)
    Kevin Conaway
    30/Jul/08 3:41 PM

Issue Links

Activity

Hide
Kevin Conaway added a comment - 30/Jul/08 3:41 PM

Attaching patch

Show
Kevin Conaway added a comment - 30/Jul/08 3:41 PM Attaching patch
Hide
David Marginian added a comment - 12/Feb/09 6:00 PM

Kevin revived this issue 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)); }

Show
David Marginian added a comment - 12/Feb/09 6:00 PM Kevin revived this issue 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)); }
Hide
David Marginian added a comment - 12/Feb/09 6:18 PM

Also, I don't think this is a major priority.

Show
David Marginian added a comment - 12/Feb/09 6:18 PM Also, I don't think this is a major priority.

People

Dates

  • Created:
    30/Jul/08 3:41 PM
    Updated:
    10/Dec/10 8:40 PM