is Exception
This role turns an exception into a control exception, such as CX::Next
or CX::Take
. It has got no code other than the definition.
Since Rakudo 2019.03, throw
ing an object that mixes in this role X::Control
can raise a control exception which is caught by the CONTROL phaser instead of CATCH. This allows to define custom control exceptions.
For example, the custom CX::Vaya
control exception we define below:
does X::Controlsub eaea;# OUTPUT: Ā«Controlled CX::Vaya: I messed up!ā¤Ā»