Skip to content

fix: should throw when mutate failed#557

Merged
shuding merged 1 commit intovercel:masterfrom
huozhi:throw-on-mutate
Jul 25, 2020
Merged

fix: should throw when mutate failed#557
shuding merged 1 commit intovercel:masterfrom
huozhi:throw-on-mutate

Conversation

@huozhi
Copy link
Member

@huozhi huozhi commented Jul 25, 2020

Fix #556

mutate failure should throw the error out. error is hidden when use mutate and useSWR hook at the same time.

  • in mutate: throw error after onUpdate callback executed
  • update test: add try catch on top of mutate call when it might throw

Copy link
Member

@shuding shuding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @huozhi!

@shuding shuding merged commit c5df6a5 into vercel:master Jul 25, 2020
@huozhi huozhi deleted the throw-on-mutate branch July 25, 2020 16:42
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.

Mutate swallows errors when using with useSWR hook.

2 participants