cacheables icon indicating copy to clipboard operation
cacheables copied to clipboard

[bug] when fetch error

Open lzsheng opened this issue 3 years ago • 2 comments

the source code wecom-temp-e957d75f5941203482c21b10ad7ca896

when the resource() error, my code return Promise.reject() source code: #fetch -> await this.#promise no try...catch. Causes cache judgment error

lzsheng avatar Dec 29 '21 03:12 lzsheng

Hey @lzsheng, sorry for replying so late. I'm not sure what you are trying to say, can you give an example? I'm also open for PRs.

grischaerbe avatar Feb 16 '22 10:02 grischaerbe

I just immediately hit this bug while trying to use this project for the first time and writing my unit tests. The PR #8 has a unit test that demonstrates the problem.

When the fetch function returns an error, the error is being cached instead of retrying. You can clearly see in the code that there is no error handling on the await.

kernwig avatar Feb 09 '24 19:02 kernwig

Fixed by #8

grischaerbe avatar Jun 27 '24 22:06 grischaerbe