FusionCache: SetAsync not throwing when failed

I’m using the library to store values in Redis. When saving data with the SetAsync method I’ve found that it doesn’t fail the task when an exception occurs when saving the data. I would like to be able to recover from this scenario as I need to ensure that the data was saved successfully. Whats the best way of handling this scenario?, digging into the code I see that the RunAsyncActionAdvancedAsync in FusionCacheExecutionUtils has a reThrow attribute that would solve the issue, but it is always being passed as false with no way to override it. I believe I could simply fetch the value afterwards with TryGet but think it would be easier if there was a way to know if the Set method failed.

Thanks for your help. I’m really liking the library so far.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18

Most upvoted comments

Hi @sanllanta , I just released v0.11.0 which includes the new feature 🎉

Hope this helps.

Hi @jodydonetti! Thanks for reaching out. I’m currently doing OK without it, but I believe it could be a great addition so we can have a bit more control on how to handle cache exceptions

Maybe it could also be set in a more granular way inside FusionCacheEntryOptions, so you could specify for which cases would you like the exceptions to bubble up.

Yes @sanllanta 😉