Commit | Line | Data |
---|---|---|
a2f2cde9 | 1 | package Catalyst::Exception; |
2 | ||
3cdcf968 | 3 | # XXX: See bottom of file for Exception implementation |
a2f2cde9 | 4 | |
a2f2cde9 | 5 | =head1 NAME |
6 | ||
7 | Catalyst::Exception - Catalyst Exception Class | |
8 | ||
9 | =head1 SYNOPSIS | |
10 | ||
11 | Catalyst::Exception->throw( qq/Fatal exception/ ); | |
12 | ||
13 | See also L<Catalyst>. | |
14 | ||
15 | =head1 DESCRIPTION | |
16 | ||
17 | This is the Catalyst Exception class. | |
18 | ||
19 | =head1 METHODS | |
20 | ||
b5ecfcf0 | 21 | =head2 throw( $message ) |
a2f2cde9 | 22 | |
b5ecfcf0 | 23 | =head2 throw( message => $message ) |
ebfde331 | 24 | |
b5ecfcf0 | 25 | =head2 throw( error => $error ) |
a2f2cde9 | 26 | |
27 | Throws a fatal exception. | |
28 | ||
3cdcf968 | 29 | =head2 meta |
30 | ||
31 | Provided by Moose | |
32 | ||
2f381252 | 33 | =head1 AUTHORS |
a2f2cde9 | 34 | |
2f381252 | 35 | Catalyst Contributors, see Catalyst.pm |
a2f2cde9 | 36 | |
37 | =head1 COPYRIGHT | |
38 | ||
536bee89 | 39 | This library is free software. You can redistribute it and/or modify |
a2f2cde9 | 40 | it under the same terms as Perl itself. |
41 | ||
42 | =cut | |
43 | ||
ede5238f | 44 | { |
45 | package Catalyst::Exception::Base; | |
3cdcf968 | 46 | |
ede5238f | 47 | use Moose; |
48 | use namespace::clean -except => 'meta'; | |
a80247cf | 49 | |
ede5238f | 50 | with 'Catalyst::Exception::Basic'; |
3cdcf968 | 51 | |
ede5238f | 52 | __PACKAGE__->meta->make_immutable; |
3cdcf968 | 53 | } |
54 | ||
ede5238f | 55 | { |
56 | package Catalyst::Exception; | |
57 | ||
58 | use Moose; | |
59 | use namespace::clean -except => 'meta'; | |
60 | ||
61 | use vars qw[$CATALYST_EXCEPTION_CLASS]; | |
62 | ||
63 | BEGIN { | |
64 | extends($CATALYST_EXCEPTION_CLASS || 'Catalyst::Exception::Base'); | |
65 | } | |
66 | ||
67 | __PACKAGE__->meta->make_immutable; | |
68 | } | |
e5ecd5bc | 69 | |
a2f2cde9 | 70 | 1; |