fregante/webext-storage-cache
`staleWhileRevalidate` may cause unhandledrejection errors
Closed
#49 opened on Oct 14, 2024
help wanted
Repository metrics
- Stars
- (82 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
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
unhandledrejectionhandler, which loses the context/origin- maybe the errors can still be caught/rewrapped to add context