Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

staleWhileRevalidate may cause unhandledrejection errors #49

Open
fregante opened this issue Oct 14, 2024 · 0 comments
Open

staleWhileRevalidate may cause unhandledrejection errors #49

fregante opened this issue Oct 14, 2024 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@fregante
Copy link
Owner

This is due to the async setTimeout(getSet) call. If the getter throws, then this error cannot be caught.

I'm not sure of how to handle this. Maybe:

  • item.onAsyncRejection(cb)
  • swallowAsyncRejections: true (default)
  • just use a global unhandledrejection handler, which loses the context/origin
    • maybe the errors can still be caught/rewrapped to add context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant