X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FException.pm;h=75064830f360abb46d90d78e3c109b9f7a50f24b;hp=ee85e1e0907fc84c0dce7a6885c5dd66229a2dcc;hb=b007fcc611c8584b634e27a60ebfe5b6f518601a;hpb=1e514a515b9b9a740962392fb280cdb11737ff02 diff --git a/lib/Catalyst/Exception.pm b/lib/Catalyst/Exception.pm index ee85e1e..7506483 100644 --- a/lib/Catalyst/Exception.pm +++ b/lib/Catalyst/Exception.pm @@ -1,16 +1,6 @@ package Catalyst::Exception; -use strict; -use vars qw[@ISA $CATALYST_EXCEPTION_CLASS]; - -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 @@ -36,29 +26,45 @@ This is the Catalyst Exception class. 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; } -=head1 AUTHOR +{ + package Catalyst::Exception; -Sebastian Riedel, C -Christian Hansen, C + use Moose; + use namespace::clean -except => 'meta'; -=head1 COPYRIGHT + use vars qw[$CATALYST_EXCEPTION_CLASS]; -This program is free software, you can redistribute it and/or modify -it under the same terms as Perl itself. + BEGIN { + extends($CATALYST_EXCEPTION_CLASS || 'Catalyst::Exception::Base'); + } -=cut + __PACKAGE__->meta->make_immutable; +} 1;