Permalink
Browse files

stylistic changes to throwing exceptions

no functional changes
  • Loading branch information...
1 parent 6555ab1 commit 5c9c02d45aebf89d661847651bfadbf58865facf @moritz moritz committed May 27, 2012
Showing with 4 additions and 5 deletions.
  1. +1 −1 src/core/Routine.pm
  2. +2 −2 src/core/Temporal.pm
  3. +1 −2 src/core/operators.pm
View
@@ -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() {
View
@@ -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 {
View
@@ -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' {

0 comments on commit 5c9c02d

Please sign in to comment.