swr
swr copied to clipboard
Fix: log error in getKey #2102
Logs caught errors in getKey within useSWRInfinite
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 |
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.
Yeah, I'm aware of that pattern. My point is that we're silently catching these errors, which makes it hard to debug.