Support for a custom superclass in ::throw
Shawn M Moore [Thu, 14 Jun 2012 19:57:54 +0000 (14:57 -0500)]
lib/Moose/Util.pm

index 967ad59..28ec30f 100644 (file)
@@ -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) : ()),
     );