Skip to content

Commit b0c48d6

Browse files
committed
Consider other exception type on build server
1 parent 7980b23 commit b0c48d6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

BitFaster.Caching.UnitTests/Atomic/AsyncAtomicFactoryTests.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,15 @@ public async Task WhenValueCreateThrowsDoesNotCauseUnobservedTaskException()
9696

9797
void OnUnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
9898
{
99-
unobservedExceptionThrown = true;
99+
if (e.Exception?.InnerException is ArithmeticException)
100+
{
101+
unobservedExceptionThrown = true;
102+
}
103+
else
104+
{
105+
Assert.Fail(e.Exception?.ToString());
106+
}
107+
100108
e.SetObserved();
101109
}
102110

@@ -110,6 +118,8 @@ static async Task AsyncAtomicFactoryGetValueAsync()
110118
catch (ArithmeticException)
111119
{
112120
}
121+
122+
await a.GetValueAsync(12, (i) => Task.FromResult(24));
113123
}
114124
}
115125

0 commit comments

Comments
 (0)