MethodInvocationErrorListener awaits an error response of a method
invocation.
When and why the event method is invoked depends on the used client.
This interface can either be instantiated directly or implemented by a class. If you instantiate it directly you must overwrite the event methods with anonymous function.
Note that overwriting the event method with a anonymous function is error-prone,
because the arguments' types and the return type are not type-checked. Instantiating
an interface directly is also not permitted in Flex.
var listener:MethodInvocationErrorListener = new MethodInvocationErrorListener();
listener.onError = function(errorInfo:MethodInvocationErrorInfo):Void {
trace("Error occured when trying to invoke the method: " + errorInfo);
}
Implementing the interface by a class is a much neater way, but sometimes adds
unnecessary complexity.
class MyListener implements MethodInvocationErrorListener {
public function onError(errorInfo:MethodInvocationErrorInfo):Void {
trace("Error occured when trying to invoke the method: " + errorInfo);
}
}
public function onError(errorInfo:MethodInvocationErrorInfo):VoidIs executed when a method invocation fails.
Known issues are:
Remember that not all clients support this functionalities.
errorInfo | contains information about the error and some useful information about the called method |