Skip to content

Commit 063d043

Browse files
authored
minor: remove throwOnError from qErrorsAllowed (#2973)
remove throwOnError from qErrorsAllowed
1 parent 439c7dd commit 063d043

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

app/api/client.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,10 @@ export const qErrorsAllowed = <Params, Data>(
291291
// not want to share the cache and mix them up
292292
queryKey: [f.name, params, ERRORS_ALLOWED],
293293
queryFn: () => f(params).then(handleResult(f.name)),
294-
// In the case of 404s, let the error bubble up to the error boundary so
295-
// we can say Not Found. If you need to allow a 404 and want it to show
296-
// up as `error` state instead, pass `throwOnError: false` as an
297-
// option from the calling component and it will override this
298-
throwOnError: (err) => err.statusCode === 404,
294+
// No point having throwOnError because errors do not throw. Worth
295+
// considering still throwing for particular errors: sometimes we expect
296+
// a 403, other times we expect 404s. We could take a list of acceptable
297+
// status codes.
299298
...options,
300299
})
301300

0 commit comments

Comments
 (0)