Skip to content

Commit

Permalink
stylistic changes to throwing exceptions
Browse files Browse the repository at this point in the history
no functional changes
  • Loading branch information
moritz committed May 27, 2012
1 parent 6555ab1 commit 5c9c02d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/Routine.pm
Expand Up @@ -89,7 +89,7 @@ my class Routine {

method unwrap($handle) {
$handle.can('restore') && $handle.restore() ||
die(X::Routine::Unwrap.new())
X::Routine::Unwrap.new.throw
}

method yada() {
Expand Down
4 changes: 2 additions & 2 deletions src/core/Temporal.pm
Expand Up @@ -91,11 +91,11 @@ my role Dateish {
method check-value($val is copy, $name, $range, :$allow-nonint) {
$val = $allow-nonint ?? +$val !! $val.Int;
$val ~~ $range
or die X::OutOfRange.new(
or X::OutOfRange.new(
what => $name,
got => $val,
range => $range,
);
).throw;
}

method check-date {
Expand Down
3 changes: 1 addition & 2 deletions src/core/operators.pm
Expand Up @@ -47,8 +47,7 @@ multi infix:<but>(Mu:D \$obj, Mu:U \$rolish, :$value! is parcel) {
$rolish.HOW.archetypes.composalizable() ?? $rolish.HOW.composalize($rolish) !!
X::Mixin::NonComposable.new(:target($obj), :$rolish).throw;
my @attrs = $role.^attributes().grep: { .has_accessor };
die(X::Role::Initialization.new())
unless @attrs == 1;
X::Role::Initialization.new.throw unless @attrs == 1;
my $mixin-value := $value;
unless nqp::istype($value, @attrs[0].type) {
if @attrs[0].type.HOW.HOW.name(@attrs[0].type.HOW) eq 'Perl6::Metamodel::EnumHOW' {
Expand Down

0 comments on commit 5c9c02d

Please sign in to comment.