Skip to content

Commit

Permalink
Fix AskTimeoutException message formatting bug (#7350)
Browse files Browse the repository at this point in the history
Co-authored-by: Aaron Stannard <aaron@petabridge.com>
  • Loading branch information
Arkatufus and Aaronontheweb authored Oct 1, 2024
1 parent 33fd92d commit 42dfbce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/Akka.Tests/Actor/AskSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public async Task Ask_should_honor_config_specified_timeout()
}
catch (AskTimeoutException e)
{
Assert.Equal("Timeout after 00:00:03 seconds", e.Message);
Assert.Equal("Timeout after 3.00 seconds", e.Message);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka/Actor/Futures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public static Task<T> Ask<T>(this ICanTell self, Func<IActorRef, object> message

ctr1 = timeoutCancellation.Token.Register(() =>
{
result.TrySetException(new AskTimeoutException($"Timeout after {timeout} seconds"));
result.TrySetException(new AskTimeoutException($"Timeout after {timeout.Value.TotalSeconds:F2} seconds"));
});

timeoutCancellation.CancelAfter(timeout.Value);
Expand Down

0 comments on commit 42dfbce

Please sign in to comment.