1 package Catalyst::Exception;
3 # XXX: See bottom of file for Exception implementation
5 package Catalyst::Exception::Base;
9 use namespace::clean -except => 'meta';
13 Catalyst::Exception - Catalyst Exception Class
17 Catalyst::Exception->throw( qq/Fatal exception/ );
23 This is the Catalyst Exception class.
27 =head2 throw( $message )
29 =head2 throw( message => $message )
31 =head2 throw( error => $error )
33 Throws a fatal exception.
42 use overload q{""} => \&as_string;
46 return $self->message;
51 my %params = @_ == 1 ? ( error => $_[0] ) : @_;
53 my $message = $params{message} || $params{error} || $! || '';
55 local $Carp::CarpLevel = 1;
66 Catalyst Contributors, see Catalyst.pm
70 This library is free software. You can redistribute it and/or modify
71 it under the same terms as Perl itself.
75 Catalyst::Exception::Base->meta->make_immutable;
77 package Catalyst::Exception;
80 use namespace::clean -except => 'meta';
82 use vars qw[$CATALYST_EXCEPTION_CLASS];
85 extends($CATALYST_EXCEPTION_CLASS || 'Catalyst::Exception::Base');
88 __PACKAGE__->meta->make_immutable;