@@ -59,7 +59,7 @@ export default class Tado {
5959 if ( data ) return JSON . parse ( data ) ;
6060 } catch ( error ) {
6161 //no persisted counter data => ignore
62- Logger . debug ( `Failed to read tado API file for user ${ this . hashedUsername } : ${ error . message || error } ` ) ;
62+ Logger . debug ( `Failed to read tado API file for user ${ this . hashedUsername } : ${ error . message || JSON . stringify ( error ) } ` ) ;
6363 }
6464 }
6565
@@ -82,7 +82,7 @@ export default class Tado {
8282 this . _counter ++ ;
8383 this . _counterTimestamp = new Date ( ) . toISOString ( ) ;
8484 } catch ( error ) {
85- Logger . warn ( `Failed to increase tado API counter: ${ error . message || error } ` ) ;
85+ Logger . warn ( `Failed to increase tado API counter: ${ error . message || JSON . stringify ( error ) } ` ) ;
8686 }
8787 }
8888
@@ -100,7 +100,7 @@ export default class Tado {
100100 data . counterData = await this . _getCounterData ( ) ;
101101 await writeFile ( join ( this . storagePath , `tado-api-${ this . hashedUsername } .json` ) , JSON . stringify ( data , null , 2 ) , "utf-8" ) ;
102102 } catch ( error ) {
103- Logger . error ( `Error while updating the tado API file for user ${ this . hashedUsername } : ${ error . message || error } ` ) ;
103+ Logger . error ( `Error while updating the tado API file for user ${ this . hashedUsername } : ${ error . message || JSON . stringify ( error ) } ` ) ;
104104 }
105105 }
106106
@@ -109,7 +109,7 @@ export default class Tado {
109109 const counter = ( await this . _getCounterData ( ) ) . counter ;
110110 Logger . info ( `tado API counter: ${ counter . toLocaleString ( 'en-US' ) } ` ) ;
111111 } catch ( error ) {
112- Logger . warn ( `Failed to get tado API counter: ${ error . message || error } ` ) ;
112+ Logger . warn ( `Failed to get tado API counter: ${ error . message || JSON . stringify ( error ) } ` ) ;
113113 }
114114 }
115115
@@ -135,7 +135,7 @@ export default class Tado {
135135
136136 return this . _tadoBearerToken . access_token ;
137137 } catch ( error ) {
138- throw new Error ( `API call failed. Could not get access token: ${ error . message || error } ` ) ;
138+ throw new Error ( `API call failed. Could not get access token: ${ error . message || JSON . stringify ( error ) } ` ) ;
139139 }
140140 }
141141
@@ -184,7 +184,7 @@ export default class Tado {
184184 await writeFile ( this . _tadoInternalTokenFilePath , JSON . stringify ( { access_token, refresh_token } ) ) ;
185185 this . _tadoBearerToken = { access_token, refresh_token, timestamp : Date . now ( ) } ;
186186 } catch ( error ) {
187- Logger . warn ( `Error while refreshing token: ${ error . message || error } ` ) ;
187+ Logger . warn ( `Error while refreshing token: ${ error . message || JSON . stringify ( error ) } ` ) ;
188188 return this . _authenticateUser ( ) ;
189189 }
190190 }
0 commit comments