mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
fix(api): properly handle errors in crawler loop
This commit is contained in:
parent
471f46eb8d
commit
0e2c56bf5f
1 changed files with 7 additions and 8 deletions
|
|
@ -99,17 +99,16 @@ export class SpotifyService {
|
||||||
{ userId: user.id },
|
{ userId: user.id },
|
||||||
`Refreshing access token failed for user "${user.id}": ${errFromAuth}`
|
`Refreshing access token failed for user "${user.id}": ${errFromAuth}`
|
||||||
);
|
);
|
||||||
|
throw errFromAuth;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// TODO sent to sentry
|
return;
|
||||||
this.logger.error(
|
|
||||||
`Unexpected error while fetching recently played tracks: ${err}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Makes no sense to keep processing the (inexistent) data but if we throw
|
this.logger.error(
|
||||||
// the error the fetch loop will not process other users.
|
`Unexpected error while fetching recently played tracks: ${err}`
|
||||||
return;
|
);
|
||||||
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (playHistory.length === 0) {
|
if (playHistory.length === 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue