Skip to content

Commit

Permalink
Handle exceptions in ArchiCacheable
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JustArchi committed Sep 30, 2024
1 parent a7f2556 commit ba11952
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ArchiSteamFarm/Helpers/ArchiCacheable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ public ArchiCacheable(Func<CancellationToken, Task<(bool Success, T? Result)>> r
} catch (OperationCanceledException e) {
ASF.ArchiLogger.LogGenericDebuggingException(e);

return GetFailedValueFor(cacheFallback);
} catch (Exception e) {
ASF.ArchiLogger.LogGenericException(e);

return GetFailedValueFor(cacheFallback);
} finally {
InitSemaphore.Release();
Expand Down

0 comments on commit ba11952

Please sign in to comment.