mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-26 07:55:55 +03:00
[PR #327] [CLOSED] Remove ModelError in favour of strongly-typed errors #398
Labels
No labels
Stale
bug
discussion
enhancement
good first issue
good first issue
help wanted
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/rspotify#398
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ramsayleung/rspotify/pull/327
Author: @SabrinaJewson
Created: 6/15/2022
Status: ❌ Closed
Base:
master← Head:no-model-error📝 Commits (6)
da97c4dRemoveModelErrorin favour of strongly-typed errorse632496RemoveClientError::CacheFile0b1f78cDocumentModelErrorremoval in changelog5678cf1Usederive(Error)instead of manual impls48a3e6dUse American English and wrap comments5894f97Merge branch 'master' into no-model-error📊 Changes
6 files changed (+126 additions, -34 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
rspotify-model/src/auth.rs(+117 -16)📝
rspotify-model/src/error.rs(+0 -11)📝
src/client_creds.rs(+2 -1)📝
src/clients/oauth.rs(+4 -1)📝
src/lib.rs(+2 -5)📄 Description
Description
ModelErrorReadTokenCacheErrorandWriteTokenCacheErrorReadFileErrorandWriteFileErrorClientError::Modelwith the more explicit and usefulClientError::UpdateTokenCacheClientError::CacheFile, which seems to have been left in by accidentMotivation and Context
Strongly-typed errors are better than weakly typed errors because:
For example, printing the backtrace of one of the new error types might give this:
Which is extremely helpful to the user.
Dependencies
None.
Type of change
Please delete options that are not relevant.
How has this been tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration
cargo test --features env-file🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.