:idea: [b]error处理[/b]
可以分为全局处理,单函数处理,批处理中处理
<1>全局处理:[code]
DWREngine.setErrorHandler(handler);[/code]
handler指的是一个函数的名字,具体的处理将在这个函数中进行
<2>单函数处理:[code]
Remote.method(
params,{
callback:function(data)
{...},
errorHandler:function(errorString,exception)
{...}});[/code]
<3>批处理中处理:[code]
DWREngine.beginBatch();
Remote.method(params,function(data){...});
DWREngine.endBatch({errorHandler:function(errorString,exception){...})});[/code]
:idea: [b]exception处理[/b]
<1>远程的方法中必须抛出异常
<2>javascript中同error
可以分为全局处理,单函数处理,批处理中处理
<1>全局处理:[code]
DWREngine.setErrorHandler(handler);[/code]
handler指的是一个函数的名字,具体的处理将在这个函数中进行
<2>单函数处理:[code]
Remote.method(
params,{
callback:function(data)
{...},
errorHandler:function(errorString,exception)
{...}});[/code]
<3>批处理中处理:[code]
DWREngine.beginBatch();
Remote.method(params,function(data){...});
DWREngine.endBatch({errorHandler:function(errorString,exception){...})});[/code]
:idea: [b]exception处理[/b]
<1>远程的方法中必须抛出异常
<2>javascript中同error