Open dhylands opened 6 years ago
Many of our error messages aren't in JSON format, they're just strings. We could probably do a better job of error handling :)
Which is why I created this issue (to do a better job of error handling)
Requires mozilla-iot/wot#65
Let's use this to track adding proper machine-readable error codes to the REST & WebSocket APIs, and target it for 0.6 as part of our "Thing UI Robustness" theme.
If I connected to a gateway which previously had a zigbee light enabled, but I restart the Pi without the Zigbee dongle, then I see the following errors in the web console (of the browser)
Error fetching on/off switch status SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Which tells me that the things controller is returning a non-JSON response for error cases.