Skip to content

Commit

Permalink
support Ask-ing for failure because it promothes hypertrophy
Browse files Browse the repository at this point in the history
  • Loading branch information
Ondřej Vondra committed Nov 11, 2024
1 parent e64d2e0 commit d12dea9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Akka/Actor/ActorRef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ protected override void TellInternal(object message, IActorRef sender)
case ISystemMessage msg:
handled = _result.TrySetException(new InvalidOperationException($"system message of type '{msg.GetType().Name}' is invalid for {nameof(FutureActorRef<T>)}"));
break;
case Status.Failure f:
case Status.Failure f when typeof(T) != typeof(Status.Failure):
handled = _result.TrySetException(f.Cause
?? new TaskCanceledException("Task cancelled by actor via Failure message."));
break;
#pragma warning disable CS0618
// for backwards compatibility
case Failure f:
case Failure f when !typeof(T).IsAssignableTo(typeof(Failure)):
handled = _result.TrySetException(f.Exception
?? new TaskCanceledException("Task cancelled by actor via Failure message."));
#pragma warning restore CS0618
Expand Down

0 comments on commit d12dea9

Please sign in to comment.