The subject says it all: can I define own control exception which would handled by the CONTROL block? Applying the X::Control role is useless:
class CX::Whatever does X::Control {
method message { "<whatever control exception>" }
}
do {
CX::Whatever.new.throw;
CONTROL {
say "CONTROL!!!";
default {
say "CONTROL: ", $_.WHAT;
}
}
}
By looking into the core sources I could guess that only a predefined set of exceptions is considered suitable for CONTROL, but not sure I didn't miss a thing.