Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
typed exception for failed sequence deduction
  • Loading branch information
moritz committed Apr 5, 2012
1 parent fd7f971 commit 2c35bdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/core/Exception.pm
Expand Up @@ -548,4 +548,8 @@ my class X::Str::Numeric is Exception {
}
}

my class X::Sequence::Deduction is Exception {
method message() { 'Unable to decude sequence' }
}

# vim: ft=perl6
2 changes: 1 addition & 1 deletion src/core/operators.pm
Expand Up @@ -137,7 +137,7 @@ sub SEQUENCE($left, $right, :$exclude_end) {
}
}
else {
$value = (sub { fail "unable to deduce sequence" })();
$value = (sub { fail X::Sequence::Deduction.new })();
}
}
take $value unless $exclude_end;
Expand Down

0 comments on commit 2c35bdb

Please sign in to comment.