Throwable/Role/Status/InternalServerError.pm

filter: Statementstmt 100% 20 / 20 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 3 totaltotal 87.1% 27 / 31 SCAR 6.9
CC
2
Cov
95%
text_body
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« Throwable/Role/Status/UnsupportedMediaType.pm ↑ Summary Throwable/Role/Status/MultipleChoices.pm »
1 package HTTP::Throwable::Role::Status::InternalServerError;
2 1 our $AUTHORITY = 'cpan:STEVAN';
3 1 $HTTP::Throwable::Role::Status::InternalServerError::VERSION = '0.027';
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 sub text_body {
19 3 ▶ my ($self) = @_;
Subroutine text_body: called CC=2 SCAR=7.0
Pod undocumented
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.027
41  
42 =head1 DESCRIPTION
43  
44 The server encountered an unexpected condition which prevented it
45 from fulfilling the request.
46  
47 =head1 ATTRIBUTES
48  
49 =head2 show_stack_trace
50  
51 This is a boolean attribute which by default is true and indicates
52 to the C<text_body> method whether or not to show the stack trace
53 in the output.
54  
55 =head1 AUTHORS
56  
57 =over 4
58  
59 =item *
60  
61 Stevan Little <stevan.little@iinteractive.com>
62  
63 =item *
64  
65 Ricardo Signes <rjbs@cpan.org>
66  
67 =back
68  
69 =head1 COPYRIGHT AND LICENSE
70  
71 This software is copyright (c) 2011 by Infinity Interactive, Inc.
72  
73 This is free software; you can redistribute it and/or modify it under
74 the same terms as the Perl 5 programming language system itself.
75  
76 =cut
77  
78 __END__
« Throwable/Role/Status/UnsupportedMediaType.pm ↑ Summary Throwable/Role/Status/MultipleChoices.pm »