During its execution, if an
ActorProcess or any method of an
Actor’s behavior object signals an uncaught exception, the actor is
By default, the system debugger is not invoked when such a crash occurs. Instead, the stack trace of the exception is logged to the standard error and to the Transcript. All of this can be configured.
When an actor terminates, its links and monitors are triggered. This happens for both normal and abnormal termination.
ActorProcess has an
exitReason instance variable (accessible
#exitReason message) that is set when the actor is
terminated. It is set when the actor terminates normally, as well as
when it terminates because of an uncaught exception.
The exit reason can take on many different values:
nilindicates “normal” termination.
Exceptionindicates an uncaught exception.
- An instance of
ActorTerminatedindicates termination caused by a linked peer’s termination.
- Any other value can be supplied when explicitly terminating an actor.
An actor can be terminated in three different ways:
Process >> #terminatesets
exitReasonto be nil.
ActorProcess >> #terminateWith:sets
exitReasonto the argument of the message.
ActorProcess >> #killsimulates an uncaught generic
Errorexception in the actor.
ActorTerminated represent a chain of actor terminations
propagating through links. An actor that signals an uncaught exception
will be terminated with the exception as its exit reason; actors
linked to that will be terminated with an
ActorTerminated as the
exit reason, with its
actor field the original signalling actor and
exitReason field the original signalled exception; and actors
linked to those will be terminated with an exit reason that adds
ActorTerminated to the chain; and so on.
As exit reasons propagate across links, the
ActorTerminated rather than just the exception value alone
allows the program or programmer to identify the actor that originally