swr icon indicating copy to clipboard operation
swr copied to clipboard

Fix: log error in getKey #2102

Open onlyanegg opened this issue 1 year ago • 3 comments

Logs caught errors in getKey within useSWRInfinite

onlyanegg avatar Aug 03 '22 20:08 onlyanegg

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 6c3c0167f3184e5a3cc1751176352d7d8b3ceb5e:

Sandbox Source
SWR-Basic Configuration
SWR-States Configuration
SWR-Infinite Configuration
SWR-SSR Configuration

codesandbox-ci[bot] avatar Aug 03 '22 20:08 codesandbox-ci[bot]

Throwing an error in the key function is a valid pattern in SWR, as described in https://beta-swr.vercel.app/docs/conditional-fetching. So I'd say logging errors would be annoying.

koba04 avatar Nov 10 '22 13:11 koba04

Yeah, I'm aware of that pattern. My point is that we're silently catching these errors, which makes it hard to debug.

onlyanegg avatar Nov 10 '22 14:11 onlyanegg