blib/lib/Langertha/Skeid/Protocol/Refusal.pm

filter: Statementstmt 100% 15 / 15 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod 100% 2 / 2 totaltotal 82.7% 24 / 29 CC 3 SCAR 7.2
CC
3
Cov
85%
refuse
3.5
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
« blib/lib/Langertha/Skeid/Secret.pm ↑ Summary blib/lib/Langertha/Skeid/CapacityProbe/Custom.pm »
1 package Langertha::Skeid::Protocol::Refusal;
2 70 our $VERSION = '0.003';
3 # ABSTRACT: A translator's deliberate refusal of a request, with a message for the client
4 70 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 70 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 70 ▶use Carp qw( croak );
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 7 ▶sub refuse {
Subroutine refuse: called CC=3 SCAR=12.5
Pod documented
10 7 my ( $class, $message ) = @_;
11 7 ▶ croak(__PACKAGE__.'->refuse needs a message') unless defined $message && length $message;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $message and length $message 0 7 7
Condition33%1/3
defined $message and length $message
!ll&&!rl&&r
007
MC/DC0%0/2
defined $message and length $message
defined $message length $message
Truth table33%1/3
A and B
A= defined $messageB= length $message
ABresult
0X0
100
111
12 7 die bless { message => $message }, $class;
13 }
14  
15 7 ▶sub message { $_[0]->{message} }
Subroutine message: called CC=1 SCAR=0.0
Pod documented
16  
17 70 1;
18  
19 __END__
20  
21 =pod
22  
23 =encoding UTF-8
24  
25 =head1 NAME
26  
27 Langertha::Skeid::Protocol::Refusal - A translator's deliberate refusal of a request, with a message for the client
28  
29 =head1 VERSION
30  
31 version 0.003
32  
33 =head1 DESCRIPTION
34  
35 A request translator that turns a request down on purpose -- a provider built-in tool, an image
36 source skeid cannot forward -- throws one of these, carrying a one-line message written for the
37 client. The proxy answers such a refusal with that message as a C<400>. Any other exception is a
38 failure of the translator's own, its text can quote the request, and the proxy answers it with a
39 fixed text instead.
40  
41 =head2 refuse
42  
43 Langertha::Skeid::Protocol::Refusal->refuse('tool type is not supported');
44  
45 Dies with a refusal carrying the message.
46  
47 =head2 message
48  
49 The client-facing message of a refusal.
50  
51 =head1 SUPPORT
52  
53 =head2 Issues
54  
55 Please report bugs and feature requests on GitHub at
56 L<https://github.com/Getty/langertha-skeid/issues>.
57  
58 =head2 IRC
59  
60 Join C<#langertha> on C<irc.perl.org> or message Getty directly.
61  
62 =head1 CONTRIBUTING
63  
64 Contributions are welcome! Please fork the repository and submit a pull request.
65  
66 =head1 AUTHOR
67  
68 Torsten Raudssus <torsten@raudssus.de> L<https://raudssus.de/>
69  
70 =head1 COPYRIGHT AND LICENSE
71  
72 This software is copyright (c) 2026 by Torsten Raudssus.
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
« blib/lib/Langertha/Skeid/Secret.pm ↑ Summary blib/lib/Langertha/Skeid/CapacityProbe/Custom.pm »