Skip to content

Fix: log error in getKey #2102 - #2103

Open
onlyanegg wants to merge 1 commit into
vercel:mainfrom
onlyanegg:log-getKey-error
Open

onlyanegg wants to merge 1 commit into
vercel:mainfrom
onlyanegg:log-getKey-error

Conversation

@onlyanegg

Copy link
Copy Markdown

Logs caught errors in getKey within useSWRInfinite

@codesandbox-ci

codesandbox-ci Bot commented Aug 3, 2022

Copy link
Copy Markdown

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 6c3c016:

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

@koba04

koba04 commented Nov 10, 2022

Copy link
Copy Markdown
Contributor

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.

@onlyanegg

Copy link
Copy Markdown
Author

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

This branch has not been deployed

No deployments
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.

2 participants