mirror of
https://github.com/jwilsson/spotify-web-api-php.git
synced 2026-04-26 23:45:49 +03:00
[PR #142] [MERGED] Added helper functions to Exceptions for easier handling. #266
Labels
No labels
bug
docs
enhancement
enhancement
enhancement
feedback wanted
good first issue
help wanted
help wanted
help wanted
invalid
pull-request
question
question
upstream
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-web-api-php#266
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/jwilsson/spotify-web-api-php/pull/142
Author: @doekenorg
Created: 11/5/2018
Status: ✅ Merged
Merged: 11/7/2018
Merged by: @jwilsson
Base:
master← Head:add-auth-exception-helpers📝 Commits (4)
c2c4036Added helper functions to Exceptions for easier handling.4d8a23dAdded some test coverage57bd605Added more coverage. Must make tests pass!b502e30Change quotes📊 Changes
3 files changed (+113 additions, -6 deletions)
View changed files
📝
src/SpotifyWebAPIAuthException.php(+24 -0)📝
src/SpotifyWebAPIException.php(+10 -1)📝
tests/RequestTest.php(+79 -5)📄 Description
To help the ease of implementation of #137 I've added some helper functions to the exceptions themself.
It's split into the two exceptions, because they both are responsible for a different part. When requesting some info using an expired access token, the general exception is triggered. For the initial authorization flow the
SpotifyWebAPIAuthExceptionis thrown.@jwilsson It was not so easy to get these error messages. I've had to generate some keys to check them later. As a result I'm not sure how we should put this under tests. If you have any ideas let me know, or be my guest 😄.
Edit: So I've tried adding some tests. I did need to change your
setupStubfunction to also be able to throw exceptions as a result. If you have issues with them, please let me know. I'd love to learn some new tricks.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.