StructuredParameters/Exception/InvalidArrayLength.pm

filter: Statementstmt 56.0% 14 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 4 / 8 Podpod 100% 4 / 4 totaltotal 59.4% 22 / 37 CC 1 SCAR 4.1
CC
1
Cov
56%
pointer
2.0
max
2.0
attempted
2.0
CRAP 1.5
« StructuredParameters/Request.pm ↑ Summary StructuredParameters/Exception.pm »
1 package PAGI::StructuredParameters::Exception::InvalidArrayLength;
2 5 $PAGI::StructuredParameters::Exception::InvalidArrayLength::VERSION = '0.001001';
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use parent -norequire, 'PAGI::StructuredParameters::Exception';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use PAGI::StructuredParameters::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # Raised when array reconstruction for a key would exceed max_array_depth.
9  
10 0 ▶sub pointer { my ($self) = @_; $self->{pointer} }
Subroutine pointer: not called CC=1 SCAR=6.9
Pod documented
11 0 ▶sub max { my ($self) = @_; $self->{max} }
Subroutine max: not called CC=1 SCAR=6.9
Pod documented
12 0 ▶sub attempted { my ($self) = @_; $self->{attempted} }
Subroutine attempted: not called CC=1 SCAR=6.9
Pod documented
13  
14 0 ▶sub message {
Subroutine message: not called CC=1 SCAR=6.9
Pod documented
15 0 my ($self) = @_;
16 0 return "Pointer '@{[ $self->pointer ]}' has array length of "
17 0 . "'@{[ $self->attempted ]}' but maximum is '@{[ $self->max ]}'.";
18 }
19  
20 5 1;
21  
22 =encoding utf8
23  
24 =head1 NAME
25  
26 PAGI::StructuredParameters::Exception::InvalidArrayLength - Array exceeded the allowed depth
27  
28 =head1 DESCRIPTION
29  
30 Raised by L<PAGI::StructuredParameters> when reconstructing an array value would
31 exceed C<max_array_depth>. Subclass of
32 L<PAGI::StructuredParameters::Exception> (HTTP status 400).
33  
34 =head1 METHODS
35  
36 =head2 pointer
37  
38 The rule key whose array was too long.
39  
40 =head2 max
41  
42 The configured maximum array depth.
43  
44 =head2 attempted
45  
46 The number of elements the incoming data attempted.
47  
48 =head2 message
49  
50 "Pointer 'children' has array length of '5000' but maximum is '1000'."
51  
52 =head1 AUTHOR
53  
54 John Napiorkowski C<< <jjnapiork@cpan.org> >>
55  
56 =head1 COPYRIGHT & LICENSE
57  
58 Copyright 2026, John Napiorkowski. This library is free software; you can
59 redistribute it and/or modify it under the same terms as Perl itself.
60  
61 =cut
« StructuredParameters/Request.pm ↑ Summary StructuredParameters/Exception.pm »