File Coverage

blib/lib/Params/CheckCompiler/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::CheckCompiler::Exceptions;
2              
3 8     8   28 use strict;
  8         7  
  8         189  
4 8     8   22 use warnings;
  8         8  
  8         445  
5              
6             our $VERSION = '0.07';
7              
8             use Exception::Class (
9 8         65 'Params::CheckCompiler::Exception::BadArguments',
10             'Params::CheckCompiler::Exception::Named::Extra' => {
11             fields => ['parameters'],
12             },
13             'Params::CheckCompiler::Exception::Named::Required' => {
14             fields => ['parameter'],
15             },
16             'Params::CheckCompiler::Exception::Positional::Extra' => {
17             fields => [ 'got', 'maximum' ],
18             },
19             'Params::CheckCompiler::Exception::Positional::Required' => {
20             fields => [ 'got', 'minimum' ],
21             },
22             'Params::CheckCompiler::Exception::ValidationFailedForMooseTypeConstraint'
23             => {
24             fields => [qw( parameter value type )],
25             },
26 8     8   2872 );
  8         44773  
27              
28             1;
29              
30             # ABSTRACT: Defines exceptions thrown by Params::CheckCompiler
31              
32             __END__
33              
34             =pod
35              
36             =encoding UTF-8
37              
38             =head1 NAME
39              
40             Params::CheckCompiler::Exceptions - Defines exceptions thrown by Params::CheckCompiler
41              
42             =head1 VERSION
43              
44             version 0.07
45              
46             =head1 DESCRIPTION
47              
48             This module defines the following exceptions:
49              
50             =head2 Params::CheckCompiler::Exception::BadArguments
51              
52             Exception thrown when @_ does not contain a hash or hashref.
53              
54             =head2 Params::CheckCompiler::Exception::Named::Extra
55              
56             Exception thrown when @_ contains unexpected extra named arguments.
57              
58             =head2 Params::CheckCompiler::Exception::Named::Required
59              
60             Exception thrown when a required named parameter is not passed.
61              
62             =head2 Params::CheckCompiler::Exception::Positional::Extra.
63              
64             Exception thrown when @_ contains unexpected extra arguments.
65              
66             =head2 Params::CheckCompiler::Exception::Positional::Required
67              
68             Exception thrown when a required positional parameter is not passed.
69              
70             =head2 Params::CheckCompiler::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 through L<the RT bug tracker|http://rt.cpan.org/Public/Dist/Display.html?Name=Params-CheckCompiler>
91             (or L<bug-params-checkcompiler@rt.cpan.org|mailto:bug-params-checkcompiler@rt.cpan.org>).
92              
93             I am also usually active on IRC as 'drolsky' on C<irc://irc.perl.org>.
94              
95             =head1 AUTHOR
96              
97             Dave Rolsky <autarch@urth.org>
98              
99             =head1 COPYRIGHT AND LICENCE
100              
101             This software is Copyright (c) 2016 by Dave Rolsky.
102              
103             This is free software, licensed under:
104              
105             The Artistic License 2.0 (GPL Compatible)
106              
107             =cut