1
0
mirror of https://github.com/beestat/app.git synced 2025-07-09 03:04:07 -04:00

Added handling for another ecobee authorization error

This commit is contained in:
Jon Ziebell 2021-03-09 21:57:11 -05:00
parent 56972013fb
commit 8992ac93fc

View File

@ -229,6 +229,14 @@ class ecobee extends external_api {
$this->api('ecobee_token', 'delete', $ecobee_token['ecobee_token_id']); $this->api('ecobee_token', 'delete', $ecobee_token['ecobee_token_id']);
throw new cora\exception('Ecobee access was revoked by user.', 10500, false, null, false); throw new cora\exception('Ecobee access was revoked by user.', 10500, false, null, false);
} }
else if (isset($response['status']) === true && $response['status']['code'] === 2) {
// Not authorized.
if($this::$log_mysql !== 'all') {
$this->log_mysql($curl_response, true);
}
$this->api('ecobee_token', 'delete', $ecobee_token['ecobee_token_id']);
throw new cora\exception('Ecobee access was revoked by user.', 10508, false, null, false);
}
else if (isset($response['status']) === true && $response['status']['code'] !== 0) { else if (isset($response['status']) === true && $response['status']['code'] !== 0) {
// Any other error // Any other error
if($this::$log_mysql !== 'all') { if($this::$log_mysql !== 'all') {