File Coverage

blib/lib/Params/ValidationCompiler/Exceptions.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Params::ValidationCompiler::Exceptions;
2              
3 17     17   514 use strict;
  17         51  
  17         497  
4 17     17   101 use warnings;
  17         51  
  17         1557  
5              
6             our $VERSION = '0.31';
7              
8             use Exception::Class (
9 17         196 'Params::ValidationCompiler::Exception::BadArguments',
10             'Params::ValidationCompiler::Exception::Named::Extra' => {
11             fields => ['parameters'],
12             },
13             'Params::ValidationCompiler::Exception::Named::Required' => {
14             fields => ['parameter'],
15             },
16             'Params::ValidationCompiler::Exception::Positional::Extra' => {
17             fields => [ 'got', 'maximum' ],
18             },
19             'Params::ValidationCompiler::Exception::Positional::Required' => {
20             fields => [ 'got', 'minimum' ],
21             },
22             'Params::ValidationCompiler::Exception::ValidationFailedForMooseTypeConstraint'
23             => {
24             fields => [qw( parameter value type )],
25             },
26 17     17   8112 );
  17         147283  
27              
28             1;
29              
30             # ABSTRACT: Defines exceptions thrown by Params::ValidationCompiler
31              
32             __END__
33              
34             =pod
35              
36             =encoding UTF-8
37              
38             =head1 NAME
39              
40             Params::ValidationCompiler::Exceptions - Defines exceptions thrown by Params::ValidationCompiler
41              
42             =head1 VERSION
43              
44             version 0.31
45              
46             =head1 DESCRIPTION
47              
48             This module defines the following exceptions:
49              
50             =head2 Params::ValidationCompiler::Exception::BadArguments
51              
52             Exception thrown when @_ does not contain a hash or hashref.
53              
54             =head2 Params::ValidationCompiler::Exception::Named::Extra
55              
56             Exception thrown when @_ contains unexpected extra named arguments.
57              
58             =head2 Params::ValidationCompiler::Exception::Named::Required
59              
60             Exception thrown when a required named parameter is not passed.
61              
62             =head2 Params::ValidationCompiler::Exception::Positional::Extra
63              
64             Exception thrown when @_ contains unexpected extra arguments.
65              
66             =head2 Params::ValidationCompiler::Exception::Positional::Required
67              
68             Exception thrown when a required positional parameter is not passed.
69              
70             =head2 Params::ValidationCompiler::Exception::ValidationFailedForMooseTypeConstraint
71              
72             Exception thrown when a Moose type constraint check fails. This class provides
73             the following methods:
74              
75             =head3 $e->parameter
76              
77             This returns a string describing the parameter, something like C<The 'foo'
78             parameter> or C<Parameter #1>.
79              
80             =head3 $e->value
81              
82             This is the value that failed the type constraint check.
83              
84             =head3 $e->type
85              
86             This is the type constraint object that did not accept the value.
87              
88             =head1 SUPPORT
89              
90             Bugs may be submitted at L<https://github.com/houseabsolute/Params-ValidationCompiler/issues>.
91              
92             =head1 SOURCE
93              
94             The source code repository for Params-ValidationCompiler can be found at L<https://github.com/houseabsolute/Params-ValidationCompiler>.
95              
96             =head1 AUTHOR
97              
98             Dave Rolsky <autarch@urth.org>
99              
100             =head1 COPYRIGHT AND LICENSE
101              
102             This software is Copyright (c) 2016 - 2023 by Dave Rolsky.
103              
104             This is free software, licensed under:
105              
106             The Artistic License 2.0 (GPL Compatible)
107              
108             The full text of the license can be found in the
109             F<LICENSE> file included with this distribution.
110              
111             =cut