When you define your own function for callState.error, your function will be passed two arguments:
function userErrorFunction(flags, message)
These arguments are;
Argument | Purpose |
---|---|
flags | A mask, which should be checked by OR-ing against the error flags shown below. |
message | If the server responded unexpectedly, this argument will contain the server’s response. |
The flags argument is a mask of the following:
Flag | Description |
---|---|
ERROR_SERVER | The server has responded successfully, but has indicated that some other error condition has occurred. The “message” argument will provide more details. |
ERROR_TIMEOUT | The server took too long to respond to a request. |
ERROR_HTTP | An unexpected network error has occurred (e.g. disconnection), and the server could not be reached. |