Merge pull request #1599 from akka/wip-3275-ActorInitializationException-patriknw
Update ActorInitializationException message to be symmetric Java/Scala, see #3275
This commit is contained in:
commit
771e92395e
1 changed files with 2 additions and 4 deletions
|
|
@ -433,10 +433,8 @@ trait Actor {
|
|||
val contextStack = ActorCell.contextStack.get
|
||||
if ((contextStack.isEmpty) || (contextStack.head eq null))
|
||||
throw ActorInitializationException(
|
||||
"\n\tYou cannot create an instance of [" + getClass.getName + "] explicitly using the constructor (new)." +
|
||||
"\n\tYou have to use one of the factory methods to create a new actor. Either use:" +
|
||||
"\n\t\t'val actor = context.actorOf(Props[MyActor])' (to create a supervised child actor from within an actor), or" +
|
||||
"\n\t\t'val actor = system.actorOf(Props(new MyActor(..)))' (to create a top level actor from the ActorSystem)")
|
||||
s"You cannot create an instance of [${getClass.getName}] explicitly using the constructor (new). " +
|
||||
"You have to use one of the 'actorOf' factory methods to create a new actor. See the documentation.")
|
||||
val c = contextStack.head
|
||||
ActorCell.contextStack.set(null :: contextStack)
|
||||
c
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue