ErrorListener

com.connectsdk.service.capability.listeners.ErrorListener

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

Situation

Connect SDK receives invalid XML from a device, generating a parsing error

Result

Connect SDK will call the ErrorListener and pass off the ServiceCommandError generated during parsing of the XML.

High-level error example

Situation

An invalid value is passed to a device capability method

Result

The capability method will immediately invoke the ErrorListener and pass off an ServiceCommandError object with a status code of ConnectStatusCodeArgumentError.

  • error

    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.

Methods

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.

Parameters:

  • error – ServiceCommandError describing the error