line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Params::CheckCompiler::Exceptions; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
30
|
use strict; |
|
9
|
|
|
|
|
9
|
|
|
9
|
|
|
|
|
203
|
|
4
|
9
|
|
|
9
|
|
26
|
use warnings; |
|
9
|
|
|
|
|
9
|
|
|
9
|
|
|
|
|
561
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.06'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use Exception::Class ( |
9
|
9
|
|
|
|
|
76
|
'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
|
9
|
|
|
9
|
|
3193
|
); |
|
9
|
|
|
|
|
49778
|
|
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.06 |
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 |