Skip to content

Commit

Permalink
Stringify error messages from Spotify API
Browse files Browse the repository at this point in the history
  • Loading branch information
poblouin committed Apr 13, 2022
1 parent 9f36650 commit bee35d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/spotify-api-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class SpotifyApiWrapper {
this.spotifyApi.setAccessToken(data.body['access_token']);
this.spotifyApi.setRefreshToken(data.body['refresh_token']);
} catch (err) {
this.log.error('Could not authorize Spotify:\n\n', err);
this.log.error('Could not authorize Spotify:\n\n', JSON.stringify(err));
}
}

Expand Down Expand Up @@ -178,7 +178,7 @@ export class SpotifyApiWrapper {
}

const errorMessage = isWebApiError ? (error as WebapiError).body : error;
this.log.error('Unexpected error when making a request to Spotify:', errorMessage);
this.log.error('Unexpected error when making a request to Spotify:', JSON.stringify(errorMessage));
}
}
}

0 comments on commit bee35d9

Please sign in to comment.