w3c/wot-scripting-api

Cover AdditionalExpectedResponses as error responses

relu91 opened this issue · 1 comments

relu91 commented

Current TD specification introduced the concept of additionalResponses to model APIs that might return different payloads from the same affordance. This issue focuses on AdditionalExpectedResponses marked with the field success: false (default). The goal is to understand how to treat these responses in our runtime. The discussion is strongly connected with #200.

relu91 commented

Call 11/12:

  • @relu91 As a draft idea we can just instruct runtimes to throw one general OperationError
  • Should we throw or return the error?
  • @JKRhb Introduce a custom error type to wrap the error and access it with a value function.
  • @ashimura we should talk about error handling in general in overall Scripting API, depending on potential responses.