mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-03 22:13:39 +01:00
Better handle homebridge errors
This commit is contained in:
parent
09fa08b037
commit
767fc1ec39
@ -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 };
|
||||
|
Loading…
x
Reference in New Issue
Block a user