From 49b31e8e6299148685cb2381cb43cd1c8a62dbb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Wed, 18 Nov 2020 21:13:16 +0100 Subject: [PATCH] fix(api): exception after refreshing spotify access token --- src/sources/spotify/spotify.service.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/sources/spotify/spotify.service.ts b/src/sources/spotify/spotify.service.ts index 25daf1b..f7f4e49 100644 --- a/src/sources/spotify/spotify.service.ts +++ b/src/sources/spotify/spotify.service.ts @@ -53,7 +53,17 @@ export class SpotifyService { accessToken, }); await this.processUser(user, false); + } else { + // TODO sent to sentry + console.error( + "Unexpected error while fetching recently played tracks", + err + ); } + + // Makes no sense to keep processing the (inexistant) data but if we throw + // the error the fetch loop will not process other users. + return; } if (playHistory.length === 0) {