Handling Errors and Warnings
Whenever there some sort of failure DWR calls an error or warning handler (depending on the severity of the error) and passes it the message.
This method could be used to display error messages in an alert box or to the status bar.
To change the error handler use dwr.engine.setErrorHandler(function), and to change the warning handler use dwr.engine.setWarningHandler(function).
For more information about handling errors and warnings, see the error handling page.
Setting Timeouts
DWREngine.setTimeout() and the call and batch level call meta-data options allow you to set a timeout values. The global DWREngine.setTimeout() function does it for all DWR calls. A value of 0 (the default) turns call timeouts off.
The units passed to setTimeout() are milli-seconds. If a call timeout happens, the the appropriate error handler is called.
Example of setting a timeout on a call level:
Remote.method(params, {
callback:function(data) { alert("it worked"); },
errorHandler:function(message) { alert("it broke"); },
timeout:1000
});
If Remote.method() takes more then 1 second to execute, the "it broke" message will be displayed.
