Throwable/Role/Status/InternalServerError.pm

filter: Statementstmt 100% 19 / 19 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 3 totaltotal 86.6% 26 / 30 CC 2 SCAR 2.6
CC
2
Cov
95%
text_body
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Throwable/Role/Generic.pm ↑ Summary Throwable/Role/Status/MultipleChoices.pm »
1 package HTTP::Throwable::Role::Status::InternalServerError 0.028;
2 1 our $AUTHORITY = 'cpan:STEVAN';
3  
4 1 ▶use Types::Standard qw(Bool);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 with(
9 'HTTP::Throwable',
10 'StackTrace::Auto',
11 );
12  
13 2 ▶sub default_status_code { 500 }
Subroutine default_status_code: called CC=1 SCAR=0.0
Pod undocumented
14 2 ▶sub default_reason { 'Internal Server Error' }
Subroutine default_reason: called CC=1 SCAR=0.0
Pod undocumented
15  
16 1 has 'show_stack_trace' => ( is => 'ro', isa => Bool, default => 1 );
17  
18 3 ▶sub text_body {
Subroutine text_body: called CC=2 SCAR=7.0
Pod undocumented
19 3 my ($self) = @_;
20  
21 3 my $out = $self->status_line;
22 3 ▶ $out .= "\n\n" . $self->stack_trace->as_string
Branch: 1 branch
BranchTrueFalseTotal
if $self->show_stack_trace 3 0 3
23 if $self->show_stack_trace;
24  
25 3 return $out;
26 }
27  
28 1 ▶no Moo::Role; 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
29  
30 =pod
31  
32 =encoding UTF-8
33  
34 =head1 NAME
35  
36 HTTP::Throwable::Role::Status::InternalServerError - 500 Internal Server Error
37  
38 =head1 VERSION
39  
40 version 0.028
41  
42 =head1 DESCRIPTION
43  
44 The server encountered an unexpected condition which prevented it
45 from fulfilling the request.
46  
47 =head1 PERL VERSION
48  
49 This library should run on perls released even a long time ago. It should work
50 on any version of perl released in the last five years.
51  
52 Although it may work on older versions of perl, no guarantee is made that the
53 minimum required version will not be increased. The version may be increased
54 for any reason, and there is no promise that patches will be accepted to lower
55 the minimum required perl.
56  
57 =head1 ATTRIBUTES
58  
59 =head2 show_stack_trace
60  
61 This is a boolean attribute which by default is true and indicates
62 to the C<text_body> method whether or not to show the stack trace
63 in the output.
64  
65 =head1 AUTHORS
66  
67 =over 4
68  
69 =item *
70  
71 Stevan Little <stevan.little@iinteractive.com>
72  
73 =item *
74  
75 Ricardo Signes <cpan@semiotic.systems>
76  
77 =back
78  
79 =head1 COPYRIGHT AND LICENSE
80  
81 This software is copyright (c) 2011 by Infinity Interactive, Inc.
82  
83 This is free software; you can redistribute it and/or modify it under
84 the same terms as the Perl 5 programming language system itself.
85  
86 =cut
87  
88 __END__
« Throwable/Role/Generic.pm ↑ Summary Throwable/Role/Status/MultipleChoices.pm »