0

Could you please provide more details about errors and exceptions:

  • What the difference between error and blocking exception for target device? What intent and what kind of response should we use in each case? Could you provide the examples?
  • Should we use ONLY errors codes in EXECUTE response? Are exceptions codes not available in EXECUTE response?
  • Can exceptions codes be used ONLY in QUERY response, which provides the status of the target device and all associated devices?
  • How should we handle blocking error of target device if desired error message is provided in the list of exceptions codes and there is no similar message in errors codes (for example, “inSoftwareUpdate”)? Could you please provide an example?
Mariia
  • 1

1 Answers1

0

A couple notes from the documentation on this point:

You should return an error code when an issue causes an execute or query request to fail.

You should return an exception when there is an issue or alert associated with a command.

To help clarify this a bit more, an ERROR generally occurs when you are unable to process the intent (can't reach the device, device is already in the expected state, etc.). An EXCEPTION is typically a related state that doesn't necessarily indicate failure (I was able to lock the door, but FYI the battery is low). This can also be the state of another device when used with the StatusReport trait.

You can return either status where appropriate in response to an intent. See the reference pages for QUERY and EXECUTE intents for more details.

Community
  • 1
  • 1
devunwired
  • 62,780
  • 12
  • 127
  • 139
  • Does it mean that the errors and exceptions are provided just to determine "the degree of error" but they can be used the same way (exception and error codes can be sent in EXECUTE and QUERY responses the same way exactly)? Then, the following response example will be valid for EXECUTE ("inSoftwareUpdate" is only in the exceptions list): `{ requestId: '123', payload: { commands: [ { ids: ['123'], status: 'ERROR', errorCode: 'inSoftwareUpdate', } ] } }`. Is it correct? – Mariia Jun 05 '20 at 17:47
  • No, the list of errors and exception codes in the documentation are separate. Some codes overlap (appear in both lists), but not all of them. Only the codes from the related list are valid for that response type. – devunwired Jun 11 '20 at 14:19