Provide more helpful message when synchronous testing ActorRef is used for asking (#27414)

This commit is contained in:
Johannes Rudolph 2019-07-25 16:42:24 +02:00 committed by Arnout Engelen
parent 4f6cccc4d8
commit 051ff07ca2

View file

@ -45,7 +45,11 @@ private[akka] final class FunctionRef[-T](override val path: ActorPath, send: (T
override def isLocal = true override def isLocal = true
// impl InternalRecipientRef, ask not supported // impl InternalRecipientRef, ask not supported
override def provider: ActorRefProvider = throw new UnsupportedOperationException("no provider") override def provider: ActorRefProvider =
throw new UnsupportedOperationException(
"ActorRefs created for synchronous testing cannot be used as targets for asking. Use asynchronous testing instead. " +
"See https://doc.akka.io/docs/akka/current/typed/testing.html#asynchronous-testing")
// impl InternalRecipientRef // impl InternalRecipientRef
def isTerminated: Boolean = false def isTerminated: Boolean = false
} }