Skip to content
Discussion options

You must be logged in to vote

@joepetrillo As the documentation explains, useSWRMutation throws an error from trigger by default, so you have to catch and handle it.
https://swr.vercel.app/docs/mutation#basic-usage

If you don't want to do that, and want to handle the error through error returned from useSWRMutation, you can do throwOnError = false so that trigger doesn't throw an error.
https://swr.vercel.app/docs/mutation#parameters-1

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@joepetrillo
Comment options

@koba04
Comment options

koba04 May 4, 2023
Collaborator

@jmayergit
Comment options

@jmayergit
Comment options

Answer selected by joepetrillo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #2599 on May 04, 2023 13:47.