Skip to content

Commit

Permalink
add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
TA2k committed Jan 8, 2024
1 parent 0c1bbf6 commit ab1969f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class Toyota extends utils.Adapter {
return res.data;
})
.catch((error) => {
this.log.error('Failed #1 step');
this.log.error(error);
if (error.response) {
this.log.error(JSON.stringify(error.response.data));
Expand Down Expand Up @@ -150,6 +151,7 @@ class Toyota extends utils.Adapter {
return res.data;
})
.catch((error) => {
this.log.error('Failed #2 step');
this.log.error(error);
if (error.response) {
this.log.error(JSON.stringify(error.response.data));
Expand Down Expand Up @@ -184,6 +186,7 @@ class Toyota extends utils.Adapter {
return res.data;
})
.catch((error) => {
this.log.error('Failed #3 step');
this.log.error(error);
if (error.response) {
this.log.error(JSON.stringify(error.response.data));
Expand Down Expand Up @@ -218,6 +221,7 @@ class Toyota extends utils.Adapter {
return res.data;
})
.catch((error) => {
this.log.error('Failed #4 step');
this.log.error(error);
if (error.response) {
this.log.error(JSON.stringify(error.response.data));
Expand Down Expand Up @@ -246,16 +250,18 @@ class Toyota extends utils.Adapter {
},
})
.then((res) => {
this.log.debug(JSON.stringify(res.data));
return res.data;
this.log.error('Failed code receive step');
this.log.error(JSON.stringify(res.data));
})
.catch((error) => {
if (error && error.message.includes('Unsupported protocol')) {
return qs.parse(error.request._options.path.split('?')[1]);
}
this.log.error('Failed #5 step');
this.log.error(error);
error.response && this.log.error(JSON.stringify(error.response.data));
});
this.log.info('Start token exchange');
await this.requestClient({
method: 'post',
maxBodyLength: Infinity,
Expand Down

0 comments on commit ab1969f

Please sign in to comment.