mfucci / node-matter

Matter protocol client / server for node.js
Apache License 2.0
119 stars 10 forks source link

Catch StatusResponse exceptions on invoke and send this status #249

Closed Apollon77 closed 1 year ago

Apollon77 commented 1 year ago

This PR uses the option that a invoked command can throw a "StatusResponseError" with a defined code and when this code is used and send out.

I decided to not use the tryCatch approach here because the error handler needs to be async and needs to await the Status send action (the alternative would be strange code in my eyes).

Apollon77 commented 1 year ago

@mfucci adjusted