In X::AdHocĀ§

See primary documentation in context for method from-slurpy

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 {
    X::AdHoc.from-slurpy3False"Not here" ).throw
};
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.