| 1 | package Valiant::Util::Exception::InvalidValidatorArgs; | ||
| 2 | |||
| 3 | use Moo; | ||
| 4 | use Data::Dumper; | ||
| 5 | extends 'Valiant::Util::Exception'; | ||
| 6 | |||
| 7 | has args => (is=>'ro', required=>1); | ||
| 8 | |||
| 9 | sub _build_message { | ||
| 10 | my ($self) = @_; | ||
| 11 | my $string = Dumper $self->args; | ||
| 12 | return "Arguments for a validator must be a Hashref not @{[ ref $self->args ]}. Data: $string"; | ||
| 13 | } | ||
| 14 | |||
| 15 | 1; | ||
| 16 | |||
| 17 | =head1 NAME | ||
| 18 | |||
| 19 | Valiant::Util::Exception::InvalidValidatorArgs - Args passed to a Validator are invalid | ||
| 20 | |||
| 21 | =head1 SYNOPSIS | ||
| 22 | |||
| 23 | throw_exception InvalidValidatorArgs => (args=>$args); | ||
| 24 | |||
| 25 | =head1 DESCRIPTION | ||
| 26 | |||
| 27 | A non categorized exception | ||
| 28 | |||
| 29 | =head1 ATTRIBUTES | ||
| 30 | |||
| 31 | =head2 args | ||
| 32 | |||
| 33 | Arguments actually passed | ||
| 34 | |||
| 35 | =head1 SEE ALSO | ||
| 36 | |||
| 37 | L<Valiant> | ||
| 38 | |||
| 39 | =head1 AUTHOR | ||
| 40 | |||
| 41 | See L<Valiant> | ||
| 42 | |||
| 43 | =head1 COPYRIGHT & LICENSE | ||
| 44 | |||
| 45 | See L<Valiant> | ||
| 46 | |||
| 47 | =cut |