See Original text in context
method from-slurpy (|cap)
Creates a new exception from a capture and returns it. The capture will have the SlurpySentry
role mixed in, so that the .message
method behaves in a different when printing the message.
try;print $!.payload.^name; # OUTPUT: «Capture+{X::AdHoc::SlurpySentry}»print $!.message; # OUTPUT: «3FalseNot here»
The SlurpySentry
role joins the elements of the payload, instead of directly converting them to a string.