Stumbled upon a gotcha recently, where this does not behave as expected:
try {
await SimpleCache.getOrSet('key', async () => {
throw Error()
return {
value: 'value',
ttl: 60
}
});
} catch (e) {
// the exception inside the set callback will not be caught here
}
I understand that there's a lot going on under the hood with SimpleCache (request collapsing and all), but it'd be more convenient if you could catch exceptions from the "outside". At the very least, this behavior should be documented.
Hello!
Stumbled upon a gotcha recently, where this does not behave as expected:
I understand that there's a lot going on under the hood with SimpleCache (request collapsing and all), but it'd be more convenient if you could catch exceptions from the "outside". At the very least, this behavior should be documented.