onError
Called when an unrecoverable error happens, for example if the remote device disconnects unexpectedly (e.g. without first sending a session termination request).
If this is called the application should call .disconnect and the object should no longer be used.
Parameters
error
the error.