package Catalyst::Exception;
-use strict;
-use vars qw[@ISA $CATALYST_EXCEPTION_CLASS];
-use UNIVERSAL::require;
-
-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
=head1 METHODS
-=over 4
-
-=item throw( $message )
+=head2 throw( $message )
-=item throw( message => $message )
+=head2 throw( message => $message )
-=item throw( error => $error )
+=head2 throw( error => $error )
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;
}
-=back
+{
+ package Catalyst::Exception;
-=head1 AUTHOR
+ use Moose;
+ use namespace::clean -except => 'meta';
-Sebastian Riedel, C<sri@cpan.org>
-Christian Hansen, C<ch@ngmedia.com>
+ use vars qw[$CATALYST_EXCEPTION_CLASS];
-=head1 COPYRIGHT
+ BEGIN {
+ extends($CATALYST_EXCEPTION_CLASS || 'Catalyst::Exception::Base');
+ }
-This program is free software, you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
+ __PACKAGE__->meta->make_immutable;
+}
1;