[PR #60] [CLOSED] Add parameter to prevent Request throwing exceptions #238

Closed
opened 2026-02-27 19:26:45 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jwilsson/spotify-web-api-php/pull/60
Author: @outspaced
Created: 12/9/2016
Status: Closed

Base: masterHead: master


📝 Commits (5)

  • 8ba73ff Added parameter to disable exceptions
  • 6778ff0 Added aa sort-of unit test
  • 80ee205 Default exceptions to true to stay consistent
  • e2c8390 Removed rogue space
  • e85523b Unit test for SpotifyWebAPI::setThrowExceptions

📊 Changes

4 files changed (+45 additions, -1 deletions)

View changed files

📝 src/Request.php (+14 -1)
📝 src/SpotifyWebAPI.php (+13 -0)
📝 tests/RequestTest.php (+10 -0)
📝 tests/SpotifyWebAPITest.php (+8 -0)

📄 Description

in the current implementation, a "rate limit exceeded" response results in Request throwing an exception. This means that SpotifyWebAPI::$lastResponse does not get set, so there is no way to access the Retry-After header.

Simply not throwing the exception means that the response gets returned, and the caller can check the status and decide if this should be an exception or not.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jwilsson/spotify-web-api-php/pull/60 **Author:** [@outspaced](https://github.com/outspaced) **Created:** 12/9/2016 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (5) - [`8ba73ff`](https://github.com/jwilsson/spotify-web-api-php/commit/8ba73ff0e62aabad13466d832301d25b2327010d) Added parameter to disable exceptions - [`6778ff0`](https://github.com/jwilsson/spotify-web-api-php/commit/6778ff06630d40fd49e43a09183e7c7fe867a450) Added aa sort-of unit test - [`80ee205`](https://github.com/jwilsson/spotify-web-api-php/commit/80ee205c98f74a4454950690b925f448f3961fea) Default exceptions to true to stay consistent - [`e2c8390`](https://github.com/jwilsson/spotify-web-api-php/commit/e2c839057edaf7fde2dd7a3be5f6f8df4653b00b) Removed rogue space - [`e85523b`](https://github.com/jwilsson/spotify-web-api-php/commit/e85523b8e72894e9e0700f49c8fc8627414a3c96) Unit test for SpotifyWebAPI::setThrowExceptions ### 📊 Changes **4 files changed** (+45 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/Request.php` (+14 -1) 📝 `src/SpotifyWebAPI.php` (+13 -0) 📝 `tests/RequestTest.php` (+10 -0) 📝 `tests/SpotifyWebAPITest.php` (+8 -0) </details> ### 📄 Description in the current implementation, a "rate limit exceeded" response results in Request throwing an exception. This means that SpotifyWebAPI::$lastResponse does not get set, so there is no way to access the Retry-After header. Simply not throwing the exception means that the response gets returned, and the caller can check the status and decide if this should be an exception or not. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 19:26:45 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-web-api-php#238
No description provided.