From: Shawn M Moore Date: Fri, 15 Jun 2012 17:37:52 +0000 (-0500) Subject: Switch to unshifting message if needed, like most of Moose X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1924a2bb70e76ab1f77d3573d8ab9aae8d88611c;p=gitmo%2FMoose.git Switch to unshifting message if needed, like most of Moose --- diff --git a/lib/Moose/Util.pm b/lib/Moose/Util.pm index 7351a25..2658ec8 100644 --- a/lib/Moose/Util.pm +++ b/lib/Moose/Util.pm @@ -472,14 +472,12 @@ sub _is_role_only_subclass { } sub throw { - my %args; - if (@_ == 1) { - $args{message} = shift; - } - else { - %args = @_; + if (@_ % 2) { + unshift @_, 'message'; } + my %args = @_; + my $superclass = delete($args{superclass}) || 'Throwable::Error'; my $roles = delete($args{roles});