ZiggyCreatures / FusionCache

FusionCache is an easy to use, fast and robust hybrid cache with advanced resiliency features.
MIT License
1.87k stars 96 forks source link

[FEATURE] 💥 Throw specific exception when factory fails without fail-safe #286

Closed jodydonetti closed 2 months ago

jodydonetti commented 3 months ago

Problem

Since v1.3.0 it's possible to trigger a factory fail without throwing an exception, so that fail-safe can kick in and do its thing.

But what happens if fail-safe is not enabled or if there's no stale value to fall back to?

Previously a plain Exception was being thrown, but that is hardly a best practice: we can do better.

Solution

Now a more specific exception type has been created and will be thrown, namely FusionCacheFactoryException.

jodydonetti commented 2 months ago

Hi, v1.4.0 has been released 🥳