Better handle homebridge errors
This commit is contained in:
1 parent
09fa08b037
commit
767fc1ec39
1 file changed
+1
@@ -64,6 +64,7 @@ async function apiCall(widget, endpoint, service) {
|
||||
|
||||
if (status !== 200) {
|
||||
logger.error("Error getting data from Homebridge: %s status %d. Data: %s", url, status, data);
|
||||
return { status, contentType, data: null, responseHeaders };
|
||||
}
|
||||
|
||||
return { status, contentType, data: JSON.parse(data.toString()), responseHeaders };
|
||||
|
||||
Reference in new issue
Block a user