File Coverage

blib/lib/Mason/Exceptions.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Mason::Exceptions;
2             $Mason::Exceptions::VERSION = '2.23';
3 20     20   87 use strict;
  20         31  
  20         619  
4 20     20   75 use warnings;
  20         27  
  20         946  
5              
6             use Exception::Class (
7 20         458 'Mason::Exception' => { description => 'generic base class for all Mason exceptions', },
8             'Mason::Exception::Abort' => {
9             isa => 'Mason::Exception',
10             fields => [qw(aborted_value)],
11             description => 'a component called $m->abort'
12             },
13              
14             'Mason::Exception::TopLevelNotFound' => {
15             isa => 'Mason::Exception',
16             description => 'the top level component could not be found'
17             },
18 20     20   626 );
  20         10021  
19              
20             1;
21              
22             __END__
23              
24             =pod
25              
26             =head1 NAME
27              
28             Mason::Exceptions - Exception objects thrown by Mason
29              
30             =head1 DESCRIPTION
31              
32             This module creates the exception classes used by Mason. Mason only throws
33             exception objects to communicate something specific to code catching the
34             exception; otherwise it is content to die with a string.
35              
36             =head1 EXCEPTIONS
37              
38             =over
39              
40             =item Mason::Exception::Abort
41              
42             The C<< $m->abort >> method was called.
43              
44             Exceptions in this class contain the field C<aborted_value>.
45              
46             =item Mason::Exception::TopLevelNotFound
47              
48             The requested top level component passed to exec() could not be found. In a web
49             environment, this could be used to determine that a 404 should be returned.
50              
51             =back
52              
53             =head1 SEE ALSO
54              
55             L<Mason|Mason>
56              
57             =head1 AUTHOR
58              
59             Jonathan Swartz <swartz@pobox.com>
60              
61             =head1 COPYRIGHT AND LICENSE
62              
63             This software is copyright (c) 2012 by Jonathan Swartz.
64              
65             This is free software; you can redistribute it and/or modify it under
66             the same terms as the Perl 5 programming language system itself.
67              
68             =cut