| 1 | package Valiant::Util::Exception::Strict; | ||
| 2 | |||
| 3 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | extends 'Valiant::Util::Exception'; | |
| 5 | |||
| 6 | 1 | has msg => (is=>'ro', required=>1); | |
| 7 | |||
| 8 | 1 | ▶ | sub _build_message { |
|
Subroutine
_build_message: called CC=1 SCAR=0.0
| |||
| 9 | 1 | my ($self) = @_; | |
| 10 | 1 | return $self->msg; | |
| 11 | } | ||
| 12 | |||
| 13 | 1 | 1; | |
| 14 | |||
| 15 | =head1 NAME | ||
| 16 | |||
| 17 | Valiant::Util::Exception::Strict - A Validation error that throws strictly | ||
| 18 | |||
| 19 | =head1 SYNOPSIS | ||
| 20 | |||
| 21 | throw_exception('Strict' => (msg=>$message)) | ||
| 22 | |||
| 23 | =head1 DESCRIPTION | ||
| 24 | |||
| 25 | If you mark a validation as strict then instead of returning error messages we get an | ||
| 26 | immediate exception thrown. | ||
| 27 | |||
| 28 | =head1 ATTRIBUTES | ||
| 29 | |||
| 30 | =head2 msg | ||
| 31 | |||
| 32 | Message that the exception will stringify to. | ||
| 33 | |||
| 34 | =head2 message | ||
| 35 | |||
| 36 | The actual exception message | ||
| 37 | |||
| 38 | =head1 SEE ALSO | ||
| 39 | |||
| 40 | L<Valiant> | ||
| 41 | |||
| 42 | =head1 AUTHOR | ||
| 43 | |||
| 44 | See L<Valiant> | ||
| 45 | |||
| 46 | =head1 COPYRIGHT & LICENSE | ||
| 47 | |||
| 48 | See L<Valiant> | ||
| 49 | |||
| 50 | =cut | ||