spotify: Handle API failures
Lots of these weren't handled, leading to crashes while importing.
To Do
- [ ] Documentation. (If you've added a new command-line flag, for example, find the appropriate page under
docs/to describe it.) - [ ] Changelog. (Add an entry to
docs/changelog.rstto the bottom of one of the lists near the top of the document.) - [ ] Tests. (Very much encouraged but not strictly required.)
Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.
Codecov Report
:x: Patch coverage is 18.51852% with 22 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 63.67%. Comparing base (5beb3d1) to head (55b3e45).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| beetsplug/spotify.py | 18.51% | 21 Missing and 1 partial :warning: |
:rocket: New features to boost your workflow:
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Maybe it is worth taking a step back here:
How do we want to handle errors in metadata plugins in general? E.g. what should happen if one plugin fails because a remote service is currently unreachable? Do we want beets to crash here or just warn a user?
I think raising errors in the specific metadata plugin (such as spotify or deezer) is completely fine. We should handle errors globally for any metadata plugins tho and warn users.
Proposal: Let's add error handling to the metadata_plugins.py file and warn the user that some plugin(s) did not complete a lookup or function call successfully. This would also move responsibilities away from the plugin developers and reduce unnecessary & duplicate error handling.
@9999years Are you planning to keep looking into the metadataplugin layer for adding error handling? If you want to take the lead on it, go ahead. I’d be glad to chime in or help out later, since it’s also needed for the aisauce plugin. From what I can tell it shouldn’t be too difficult to add.
@semohr Feel free, I might get back to this in the future but I'm not sure when.