1
# XXX should really be my X::Base eventually
2
my class X::Base is Exception {
5
multi method Str(X::Base:D:) {
6
$.message.Str // 'Something went wrong'
9
multi method gist(X::Base:D:) {
10
$.message ~ "\n" ~ $.backtrace;
21
multi method gist(::?CLASS:D:) {
22
"===SORRY!===\n$.message\nat $.filename():$.line";
26
my class X::NYI is X::Base {
28
method message() { "$.feature not yet implemented. Sorry. " }
31
my class X::OutOfRange is X::Base {
32
has $.what = 'Argument';
33
has $.got = '<unknown>';
34
has $.range = '<unknown>';
36
"$.what out of range. Is: $.got, should be in $.range"
40
my class X::Buf::AsStr is X::Base {
43
"Cannot use a Buf as a string, but you called the $.method method on it";
47
my class X::Signature::Placeholder is X::Base does X::Comp {
49
'Placeholder variable cannot override existing signature';
53
my class X::Attribute::Undeclared is X::Base does X::Comp {
58
"Attribute $.name not declared in $.package-type $.package-name";
62
my class X::Obsolete is X::Base does X::Comp {
65
has $.when = 'in Perl 6';
66
method message() { "Unsupported use of $.old; $.when please use $.new" }