Throwable/Role/Status/ServiceUnavailable.pm

filter: Statementstmt 100% 22 / 22 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 90.6% 29 / 32 CC 2 SCAR 2.5
CC
2
Cov
96%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Throwable/Role/Status/MultipleChoices.pm ↑ Summary Throwable/Role/Status/ProxyAuthenticationRequired.pm »
1 package HTTP::Throwable::Role::Status::ServiceUnavailable 0.028;
2 1 our $AUTHORITY = 'cpan:STEVAN';
3  
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 2 ▶around 'build_headers' => sub {
Subroutine __ANON__: called CC=2 SCAR=7.0
19 2 my $next = shift;
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.028
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 PERL VERSION
57  
58 This library should run on perls released even a long time ago. It should work
59 on any version of perl released in the last five years.
60  
61 Although it may work on older versions of perl, no guarantee is made that the
62 minimum required version will not be increased. The version may be increased
63 for any reason, and there is no promise that patches will be accepted to lower
64 the minimum required perl.
65  
66 =head1 AUTHORS
67  
68 =over 4
69  
70 =item *
71  
72 Stevan Little <stevan.little@iinteractive.com>
73  
74 =item *
75  
76 Ricardo Signes <cpan@semiotic.systems>
77  
78 =back
79  
80 =head1 COPYRIGHT AND LICENSE
81  
82 This software is copyright (c) 2011 by Infinity Interactive, Inc.
83  
84 This is free software; you can redistribute it and/or modify it under
85 the same terms as the Perl 5 programming language system itself.
86  
87 =cut
88  
89 __END__
« Throwable/Role/Status/MultipleChoices.pm ↑ Summary Throwable/Role/Status/ProxyAuthenticationRequired.pm »