1package HTTP::Throwable::Role::Status::InternalServerError;
2our $AUTHORITY = 'cpan:STEVAN';
3$HTTP::Throwable::Role::Status::InternalServerError::VERSION = '0.027';
4use Types::Standard qw(Bool);
5
6use Moo::Role;
7
8with(
9    'HTTP::Throwable',
10    'StackTrace::Auto',
11);
12
13sub default_status_code { 500 }
14sub default_reason      { 'Internal Server Error' }
15
16has 'show_stack_trace' => ( is => 'ro', isa => Bool, default => 1 );
17
18sub text_body {
19    my ($self) = @_;
20
21    my $out = $self->status_line;
22    $out .= "\n\n" . $self->stack_trace->as_string
23        if $self->show_stack_trace;
24
25    return $out;
26}
27
28no Moo::Role; 1;
29
30=pod
31
32=encoding UTF-8
33
34=head1 NAME
35
36HTTP::Throwable::Role::Status::InternalServerError - 500 Internal Server Error
37
38=head1 VERSION
39
40version 0.027
41
42=head1 DESCRIPTION
43
44The server encountered an unexpected condition which prevented it
45from fulfilling the request.
46
47=head1 ATTRIBUTES
48
49=head2 show_stack_trace
50
51This is a boolean attribute which by default is true and indicates
52to the C<text_body> method whether or not to show the stack trace
53in the output.
54
55=head1 AUTHORS
56
57=over 4
58
59=item *
60
61Stevan Little <stevan.little@iinteractive.com>
62
63=item *
64
65Ricardo Signes <rjbs@cpan.org>
66
67=back
68
69=head1 COPYRIGHT AND LICENSE
70
71This software is copyright (c) 2011 by Infinity Interactive, Inc.
72
73This is free software; you can redistribute it and/or modify it under
74the same terms as the Perl 5 programming language system itself.
75
76=cut
77
78__END__
79
80# ABSTRACT: 500 Internal Server Error
81
82#pod =head1 DESCRIPTION
83#pod
84#pod The server encountered an unexpected condition which prevented it
85#pod from fulfilling the request.
86#pod
87#pod =attr show_stack_trace
88#pod
89#pod This is a boolean attribute which by default is true and indicates
90#pod to the C<text_body> method whether or not to show the stack trace
91#pod in the output.
92#pod
93