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 Catalyst Contributors, see Catalyst.pm
57 This library is free software. You can redistribute it and/or modify
58 it under the same terms as Perl itself.
62 Catalyst::Exception::Base->meta->make_immutable;
64 package Catalyst::Exception;
67 use vars qw[$CATALYST_EXCEPTION_CLASS];
70 extends($CATALYST_EXCEPTION_CLASS || 'Catalyst::Exception::Base');
74 __PACKAGE__->meta->make_immutable;