mirror of
https://github.com/beestat/app.git
synced 2025-07-09 03:04:07 -04:00
Better handling for ecobee authorization errors
This commit is contained in:
parent
f611cb4174
commit
ac2ae13690
@ -250,6 +250,14 @@ class ecobee extends external_api {
|
||||
}
|
||||
throw new Exception($response['status']['message']);
|
||||
}
|
||||
else if (isset($response['error']) === true) {
|
||||
// Authorization errors are a bit different
|
||||
// https://www.ecobee.com/home/developer/api/documentation/v1/auth/auth-req-resp.shtml
|
||||
if($this::$log_mysql !== 'all') {
|
||||
$this->log_mysql($curl_response, true);
|
||||
}
|
||||
throw new Exception(isset($response['error_description']) === true ? $response['error_description'] : $response['error']);
|
||||
}
|
||||
else {
|
||||
return $response;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user