goto \&confess
}
+sub throw_exception {
+ shift;
+
+ my %args;
+ if (@_ == 1) {
+ $args{message} = shift;
+ }
+ else {
+ %args = @_;
+ }
+
+ my $roles = delete($args{roles});
+
+ my $metaclass = Moose::Meta::Class->create_anon_class(
+ superclasses => ['Throwable::Error'],
+ ($roles ? (roles => $roles) : ()),
+ );
+
+ $metaclass->name->throw(\%args);
+}
+
sub extends {
my $meta = shift;