Created
February 8, 2026 13:57
-
-
Save vanaf1979/8064060dd2bbe358d8a8e4759d049d6e to your computer and use it in GitHub Desktop.
Fetch throw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (!response.ok) { | |
| const errorBody = await response.json(); | |
| throw new Error(errorBody.message || 'Something went wrong on the server'); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment