1 package Catalyst::Exception;
3 # XXX: See bottom of file for Exception implementation
5 package Catalyst::Exception::Base;
12 Catalyst::Exception - Catalyst Exception Class
16 Catalyst::Exception->throw( qq/Fatal exception/ );
22 This is the Catalyst Exception class.
26 =head2 throw( $message )
28 =head2 throw( message => $message )
30 =head2 throw( error => $error )
32 Throws a fatal exception.
38 my %params = @_ == 1 ? ( error => $_[0] ) : @_;
40 my $message = $params{message} || $params{error} || $! || '';
42 local $Carp::CarpLevel = 1;
44 Carp::croak($message);
53 Sebastian Riedel, C<sri@cpan.org>
54 Christian Hansen, C<ch@ngmedia.com>
58 This program is free software, you can redistribute it and/or modify
59 it under the same terms as Perl itself.
63 Catalyst::Exception::Base->meta->make_immutable;
65 package Catalyst::Exception;
68 use vars qw[$CATALYST_EXCEPTION_CLASS];
71 extends($CATALYST_EXCEPTION_CLASS || 'Catalyst::Exception::Base');
75 __PACKAGE__->meta->make_immutable;