Generic asynchronous operation response error handler block. In all cases, you will get a valid ServiceCommandError object. Connect SDK will make all attempts to give you the lowest-level error possible. In cases where an error is generated by Connect SDK, an enumerated error code (ConnectStatusCode) will be present on the ServiceCommandError object.
Low-level error example¶
Connect SDK receives invalid XML from a device, generating a parsing error
Connect SDK will call the ErrorListener and pass off the ServiceCommandError generated during parsing of the XML.
High-level error example¶
An invalid value is passed to a device capability method
The capability method will immediately invoke the ErrorListener and pass off an ServiceCommandError object with a status code of ConnectStatusCodeArgumentError.
ServiceCommandError object describing the nature of the problem. Error descriptions are not localized and mostly intended for developer use. It is not recommended to display most error descriptions in UI elements.
- void onError (ServiceCommandError error)
Method to return the error that was generated. Will pass an error object with a helpful status code and error message.
- error – ServiceCommandError describing the error