Skip to content

SetFailSafe(true) and exception handling #234

Answered by jodydonetti
tjmoore asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @tjmoore and thanks for using FusionCache!

Am I right in thinking any exception at all from the factory method will be treated as downtime/failure, consumed and return from cache, not exposing the exception to the caller?

Yes and no: IF you enable fail-safe AND there's a stale (expired) value to use as a fallback (AND/OR you haven't specified a fail-safe default value in the call) then yes, no exception will be exposed to the caller since that's the whole point of fail-safe.

BUT if there's no stale value (like, the first time a factory is called and you haven't specified a fail-safe default value) then the factory exception will be exposed to the caller.

What if the factory method m…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tjmoore
Comment options

@jodydonetti
Comment options

Answer selected by tjmoore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants