add github issue tracker links to contributing documentation
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Exception.pm
index ee85e1e..7506483 100644 (file)
@@ -1,16 +1,6 @@
 package Catalyst::Exception;
 
-use strict;
-use vars qw[@ISA $CATALYST_EXCEPTION_CLASS];
-
-BEGIN {
-    push( @ISA, $CATALYST_EXCEPTION_CLASS || 'Catalyst::Exception::Base' );
-}
-
-package Catalyst::Exception::Base;
-
-use strict;
-use Carp ();
+# XXX: See bottom of file for Exception implementation
 
 =head1 NAME
 
@@ -36,29 +26,45 @@ This is the Catalyst Exception class.
 
 Throws a fatal exception.
 
+=head2 meta
+
+Provided by Moose
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
 =cut
 
-sub throw {
-    my $class  = shift;
-    my %params = @_ == 1 ? ( error => $_[0] ) : @_;
+{
+    package Catalyst::Exception::Base;
 
-    my $message = $params{message} || $params{error} || $! || '';
+    use Moose;
+    use namespace::clean -except => 'meta';
 
-    local $Carp::CarpLevel = 1;
+    with 'Catalyst::Exception::Basic';
 
-    Carp::croak($message);
+    __PACKAGE__->meta->make_immutable;
 }
 
-=head1 AUTHOR
+{
+    package Catalyst::Exception;
 
-Sebastian Riedel, C<sri@cpan.org>
-Christian Hansen, C<ch@ngmedia.com>
+    use Moose;
+    use namespace::clean -except => 'meta';
 
-=head1 COPYRIGHT
+    use vars qw[$CATALYST_EXCEPTION_CLASS];
 
-This program is free software, you can redistribute it and/or modify
-it under the same terms as Perl itself.
+    BEGIN {
+        extends($CATALYST_EXCEPTION_CLASS || 'Catalyst::Exception::Base');
+    }
 
-=cut
+    __PACKAGE__->meta->make_immutable;
+}
 
 1;