0

Could you please clarify if it's possible to use the following error codes with Cook trait:

  • dispenseAmountRemainingExceeded: <device(s)> doesn't have enough <dispense_item> to do that;
  • dispenseFractionalAmountNotSupported: <device(s)> can't dispense fractions of <dispense_item>;
  • dispenseFractionalUnitNotSupported: <device(s)> doesn't support fractions of that unit for <dispense_item>;
  • dispenseUnitNotSupported: <device(s)> doesn't support that unit for <dispense_item> ?

If possible, what value will be used instead of <dispense_item> in the error message? What needs to be done for this?

Mariia
  • 1

1 Answers1

0

Generally speaking, the platform error codes are not trait-specific and you can report whichever error suits your use case. There is an exception to this, however, for errors respond with a parameter from the request (like the dispense_item in your example). These errors will not return the proper response if they are returned from a different EXECUTE command (we are working in clarifying this in our documentation).

While this is currently not supported, it's a reasonable request so you could consider filing a feature request. In the short term, it might also suit your use case to implement the Dispense trait if you wish to support these conditions.

devunwired
  • 62,780
  • 12
  • 127
  • 139