File Coverage

blib/lib/HTTP/Throwable/Role/Status/InternalServerError.pm
Criterion Covered Total %
statement 15 15 100.0
branch 1 2 50.0
condition n/a
subroutine 6 6 100.0
pod 0 3 0.0
total 22 26 84.6


line stmt bran cond sub pod time code
1             package HTTP::Throwable::Role::Status::InternalServerError;
2             our $AUTHORITY = 'cpan:STEVAN';
3             $HTTP::Throwable::Role::Status::InternalServerError::VERSION = '0.026';
4 1     1   1563 use Types::Standard qw(Bool);
  1         69259  
  1         11  
5              
6 1     1   1635 use Moo::Role;
  1         17652  
  1         7  
7              
8             with(
9             'HTTP::Throwable',
10             'StackTrace::Auto',
11             );
12              
13 2     2 0 133 sub default_status_code { 500 }
14 2     2 0 12324 sub default_reason { 'Internal Server Error' }
15              
16             has 'show_stack_trace' => ( is => 'ro', isa => Bool, default => 1 );
17              
18             sub text_body {
19 3     3 0 6 my ($self) = @_;
20              
21 3         11 my $out = $self->status_line;
22 3 50       17 $out .= "\n\n" . $self->stack_trace->as_string
23             if $self->show_stack_trace;
24              
25 3         3138 return $out;
26             }
27              
28 1     1   449 no Moo::Role; 1;
  1         2  
  1         5  
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.026
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 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
62              
63             =item *
64              
65             Ricardo Signes
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__