Commit b43e363
committed
fix: Catch simultaneous sync and async errors from different providers
- ProviderError thrown in sync ReleaseLookup constructor: Invalid URL/ID
- Any error thrown during the async stages of a release lookup
Both kinds of errors are handled as expected on their own (even if there
are errors from multiple providers), but a combination of a sync error
and an async error was able to crash the whole server app.
Example: Deezer substitutes a release AND an invalid iTunes ID was given
GET /release?deezer=550027882&itunes=1721471900%C2%AEion%3DKR
> error: Uncaught (in promise) ProviderError: API returned https://www.deezer.com/album/907615612 instead of the requested https://www.deezer.com/album/550027882
This scenario is very rare because invalid URLs/IDs are usually only
specified by beginner users or bad bots which are unlikely to trigger a
valid but failing provider lookup at the same time.1 parent f7d55d4 commit b43e363
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
| |||
0 commit comments