Handle exceptions in ArchiCacheable

While our code does not throw them, this is public helper and we don't need to enforce from other callers exceptions-less flow. We can use it for a failure.
This commit is contained in:
Łukasz Domeradzki
2024-09-30 19:16:52 +02:00
parent a7f2556b48
commit ba11952945

View File

@@ -87,6 +87,10 @@ public sealed class ArchiCacheable<T> : IDisposable {
} catch (OperationCanceledException e) {
ASF.ArchiLogger.LogGenericDebuggingException(e);
return GetFailedValueFor(cacheFallback);
} catch (Exception e) {
ASF.ArchiLogger.LogGenericException(e);
return GetFailedValueFor(cacheFallback);
} finally {
InitSemaphore.Release();