1 package Catalyst::Exception;
4 use vars qw[@ISA $CATALYST_EXCEPTION_CLASS];
5 use UNIVERSAL::require;
8 push( @ISA, $CATALYST_EXCEPTION_CLASS || 'Catalyst::Exception::Base' );
11 package Catalyst::Exception::Base;
18 Catalyst::Exception - Catalyst Exception Class
22 Catalyst::Exception->throw( qq/Fatal exception/ );
28 This is the Catalyst Exception class.
34 =item throw( $message )
36 =item throw( message => $message )
38 =item throw( error => $error )
40 Throws a fatal exception.
46 my %params = @_ == 1 ? ( error => $_[0] ) : @_;
48 my $message = $params{message} || $params{error} || $! || '';
50 local $Carp::CarpLevel = 1;
52 Carp::croak($message);
59 Sebastian Riedel, C<sri@cpan.org>
60 Christian Hansen, C<ch@ngmedia.com>
64 This program is free software, you can redistribute it and/or modify
65 it under the same terms as Perl itself.