Permalink
Browse files

Add X::Comp::Trait exception

  • Loading branch information...
1 parent fb836dc commit 0d3c78cf4b963d9f324c757813b37cff03fa48a1 @lizmat lizmat committed Jul 27, 2013
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/core/Exception.pm
View
@@ -451,6 +451,16 @@ my class X::NYI is Exception {
}
my class X::Comp::NYI is X::NYI does X::Comp { };
+my class X::Trait is Exception {
+ has $.type; # is, will, of etc.
+ has $.subtype; # wrong subtype being tried
+ has $.declaring; # variable, sub, parameter, etc.
+ method message () {
+ "You cannot say '$.type $.subtype' in a $.declaring declaration."
+ }
+}
+my class X::Comp::Trait is X::Trait does X::Comp { };
+
my class X::OutOfRange is Exception {
has $.what = 'Argument';
has $.got = '<unknown>';

0 comments on commit 0d3c78c

Please sign in to comment.