Throwable/Role/Status/ServiceUnavailable.pm

filter: Statementstmt 100% 23 / 23 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 90.9% 30 / 33 SCAR 6.9
CC
2
Cov
96%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« Throwable/Role/Status/MultipleChoices.pm ↑ Summary Throwable/Role/Status/ProxyAuthenticationRequired.pm »
1 package HTTP::Throwable::Role::Status::ServiceUnavailable;
2 1 our $AUTHORITY = 'cpan:STEVAN';
3 1 $HTTP::Throwable::Role::Status::ServiceUnavailable::VERSION = '0.027';
4 1 ▶use Types::Standard qw(Str);
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 'HTTP::Throwable::Role::BoringText',
11 );
12  
13 2 ▶sub default_status_code { 503 }
Subroutine default_status_code: called CC=1 SCAR=0.0
Pod undocumented
14 2 ▶sub default_reason { 'Service Unavailable' }
Subroutine default_reason: called CC=1 SCAR=0.0
Pod undocumented
15  
16 1 has 'retry_after' => ( is => 'ro', isa => Str );
17  
18 around 'build_headers' => sub {
19 2 ▶ my $next = shift;
Subroutine __ANON__: called CC=2 SCAR=7.0
20 2 my $self = shift;
21 2 my $headers = $self->$next( @_ );
22 2 ▶ if ( my $retry = $self->retry_after ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $retry = $self->retry_after) 2 0 2
23 2 push @$headers => ('Retry-After' => $retry);
24 }
25 2 $headers;
26 1 };
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::ServiceUnavailable - 503 Service Unavailable
37  
38 =head1 VERSION
39  
40 version 0.027
41  
42 =head1 DESCRIPTION
43  
44 The server is currently unable to handle the request due to
45 a temporary overloading or maintenance of the server. The
46 implication is that this is a temporary condition which will
47 be alleviated after some delay. If known, the length of the
48 delay MAY be indicated in a Retry-After header. If no
49 Retry-After is given, the client SHOULD handle the response as
50 it would for a 500 response.
51  
52 Note: The existence of the 503 status code does not imply that a
53 server must use it when becoming overloaded. Some servers may wish
54 to simply refuse the connection.
55  
56 =head1 AUTHORS
57  
58 =over 4
59  
60 =item *
61  
62 Stevan Little <stevan.little@iinteractive.com>
63  
64 =item *
65  
66 Ricardo Signes <rjbs@cpan.org>
67  
68 =back
69  
70 =head1 COPYRIGHT AND LICENSE
71  
72 This software is copyright (c) 2011 by Infinity Interactive, Inc.
73  
74 This is free software; you can redistribute it and/or modify it under
75 the same terms as the Perl 5 programming language system itself.
76  
77 =cut
78  
79 __END__
« Throwable/Role/Status/MultipleChoices.pm ↑ Summary Throwable/Role/Status/ProxyAuthenticationRequired.pm »