Commit | Line | Data |
08f9c848 |
1 | package TestAppClassExceptionSimpleTest::Exceptions; |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | BEGIN { |
7 | $Catalyst::Exception::CATALYST_EXCEPTION_CLASS = 'TestAppClassExceptionSimpleTest::Exception'; |
8 | |
9 | my %classes = ( |
10 | 'TestAppClassExceptionSimpleTest::Exception' => { |
11 | description => 'Generic exception', |
12 | alias => 'throw' |
13 | }, |
14 | ); |
15 | |
16 | my @exports = grep { defined } map { $classes{ $_ }->{ alias } } keys %classes; |
17 | |
18 | require Exception::Class; |
19 | require Sub::Exporter; |
20 | |
21 | Exception::Class->import(%classes); |
22 | Sub::Exporter->import( -setup => { exports => \@exports } ); |
23 | } |
24 | |
25 | package TestAppClassExceptionSimpleTest::Exception; |
26 | |
08f9c848 |
27 | use strict; |
28 | use warnings; |
29 | no warnings 'redefine'; |
30 | |
31 | use HTTP::Headers (); |
32 | use HTTP::Status (); |
33 | use Scalar::Util qw( blessed ); |
34 | |
35 | sub status { |
36 | return $_[0]->{status} ||= 500; |
37 | } |
38 | |
39 | ######### |
40 | |
41 | package TestAppClassExceptionSimpleTest; |
42 | |
43 | use strict; |
44 | use warnings; |
45 | use Scalar::Util (); |
46 | use Catalyst::Runtime '5.80'; |
47 | |
48 | use Catalyst qw/ -Debug /; |
49 | |
50 | our $VERSION = '0.02'; |
51 | |
08f9c848 |
52 | __PACKAGE__->setup; |
53 | |
08f9c848 |
54 | 1; |