update distar url
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Exception.pm
1 package Catalyst::Exception;
2
3 # XXX: See bottom of file for Exception implementation
4
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
21 =head2 throw( $message )
22
23 =head2 throw( message => $message )
24
25 =head2 throw( error => $error )
26
27 Throws a fatal exception.
28
29 =head2 meta
30
31 Provided by Moose
32
33 =head1 AUTHORS
34
35 Catalyst Contributors, see Catalyst.pm
36
37 =head1 COPYRIGHT
38
39 This library is free software. You can redistribute it and/or modify
40 it under the same terms as Perl itself.
41
42 =cut
43
44 {
45     package Catalyst::Exception::Base;
46
47     use Moose;
48     use namespace::clean -except => 'meta';
49
50     with 'Catalyst::Exception::Basic';
51
52     __PACKAGE__->meta->make_immutable;
53 }
54
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 }
69
70 1;