From: Shawn M Moore Date: Thu, 14 Jun 2012 19:57:54 +0000 (-0500) Subject: Support for a custom superclass in ::throw X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2c06871b8fbea43126d1a9bd86da7b9cd0aaf39c;p=gitmo%2FMoose.git Support for a custom superclass in ::throw --- diff --git a/lib/Moose/Util.pm b/lib/Moose/Util.pm index 967ad59..28ec30f 100644 --- a/lib/Moose/Util.pm +++ b/lib/Moose/Util.pm @@ -480,10 +480,11 @@ sub throw { %args = @_; } + my $superclasses = delete($args{superclasses}) || ['Throwable::Error']; my $roles = delete($args{roles}); my $metaclass = Moose::Meta::Class->create_anon_class( - superclasses => ['Throwable::Error'], + superclasses => $superclasses, ($roles ? (roles => $roles) : ()), );