File Coverage

blib/lib/Perl/Critic/Exception/Fatal.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 2 2 100.0
total 25 25 100.0


line stmt bran cond sub pod time code
1             package Perl::Critic::Exception::Fatal;
2              
3 40     40   25843 use 5.010001;
  40         158  
4 40     40   226 use strict;
  40         93  
  40         878  
5 40     40   196 use warnings;
  40         121  
  40         2261  
6              
7             our $VERSION = '1.150';
8              
9             #-----------------------------------------------------------------------------
10              
11             use Exception::Class (
12 40         531 'Perl::Critic::Exception::Fatal' => {
13             isa => 'Perl::Critic::Exception',
14             description =>
15             'A problem that should cause Perl::Critic to stop running.',
16             },
17 40     40   383 );
  40         149  
18              
19             #-----------------------------------------------------------------------------
20              
21             sub new {
22 22     22 1 11786 my ($class, @args) = @_;
23 22         115 my $self = $class->SUPER::new(@args);
24              
25 22         15457 $self->show_trace(1);
26              
27 22         15231 return $self;
28             }
29              
30             #-----------------------------------------------------------------------------
31              
32             sub full_message {
33 10     10 1 2932 my ( $self ) = @_;
34              
35             return
36 10         53 $self->short_class_name()
37             . q{: }
38             . $self->description()
39             . "\n\n"
40             . $self->message()
41             . "\n\n"
42             . gmtime $self->time()
43             . "\n\n";
44             }
45              
46              
47             1;
48              
49             __END__
50              
51             #-----------------------------------------------------------------------------
52              
53             =pod
54              
55             =for stopwords
56              
57             =head1 NAME
58              
59             Perl::Critic::Exception::Fatal - A problem that should cause L<Perl::Critic|Perl::Critic> to stop running.
60              
61             =head1 DESCRIPTION
62              
63             Something went wrong and processing should not continue. You should
64             never specifically look for this exception or one of its subclasses.
65              
66             Note: the constructor invokes L<Exception::Class/"show_trace"> to
67             force stack-traces to be included in the standard stringification.
68              
69             This is an abstract class. It should never be instantiated.
70              
71              
72             =head1 INTERFACE SUPPORT
73              
74             This is considered to be a public class. Any changes to its interface
75             will go through a deprecation cycle.
76              
77              
78             =head1 METHODS
79              
80             =over
81              
82             =item C<full_message()>
83              
84             Overrides L<Exception::Class/"full_message"> to include extra
85             information.
86              
87              
88             =back
89              
90              
91             =head1 AUTHOR
92              
93             Elliot Shank <perl@galumph.com>
94              
95             =head1 COPYRIGHT
96              
97             Copyright (c) 2007-2011 Elliot Shank.
98              
99             This program is free software; you can redistribute it and/or modify
100             it under the same terms as Perl itself. The full text of this license
101             can be found in the LICENSE file included with this module.
102              
103             =cut
104              
105             # Local Variables:
106             # mode: cperl
107             # cperl-indent-level: 4
108             # fill-column: 78
109             # indent-tabs-mode: nil
110             # c-indentation-style: bsd
111             # End:
112             # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :