Skip to content

Add error handling to getMoreSongs#137

Open
Sam12354 wants to merge 1 commit into
bradtraversy:masterfrom
Sam12354:fix-error-handling
Open

Add error handling to getMoreSongs#137
Sam12354 wants to merge 1 commit into
bradtraversy:masterfrom
Sam12354:fix-error-handling

Conversation

@Sam12354

Copy link
Copy Markdown

This adds some basic error handling to the getMoreSongs function.

Before, if the request failed or something went wrong with the API, the app could break without any clear message.

Now it:

  • uses try/catch around the fetch call
  • checks the response before using the data
  • logs errors to help with debugging

Just makes things a bit more stable when the API or network has issues.

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