Skip to content

Conversation

@teenorth
Copy link

Summary

This PR implements a error handling class to store more information about the error that took place. Primarily this allows for the error to return the full response object.

The reason for this was to get access to the retry time header returned when we receive a 429 rate limit error.

Changes

  • Added new interface ISpotifyError
  • Added new class SpotifyError extending Error and implementing ISpotifyError
  • Modified DefaultResponseValidator to throw SpotifyError with additional context to the error including the response

Results

Errors returned by failed requests will now have status, statusText and the response object that failed. This change is backwards compatible because it extends Error. Which was being returned prior to this change. This only adds additional context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant