Skip to content

Commit b970f67

Browse files
okazkayasiTkDodoautofix-ci[bot]
authoredJul 18, 2024
docs: Throw error or mutation doesn't see any the 500 coming from API (#7754)
* Throw error or mutation doesn't see any the 500 coming from API * fix: prettier * ci: apply automated fixes --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 98d127a commit b970f67

File tree

1 file changed

+3
-0
lines changed
  • examples/react/optimistic-updates-ui/src/pages

1 file changed

+3
-0
lines changed
 

‎examples/react/optimistic-updates-ui/src/pages/index.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ function Example() {
3939
body: JSON.stringify({ text: newTodo }),
4040
headers: { 'Content-Type': 'application/json' },
4141
})
42+
if (!response.ok) {
43+
throw new Error('Something went wrong.')
44+
}
4245
return await response.json()
4346
},
4447
onSettled: () => queryClient.invalidateQueries({ queryKey: ['todos'] }),

0 commit comments

Comments
 (0)