MooseX...traint(3pm)
π NAME π
MooseX::Params::Validate::Exception::ValidationFailedForTypeConstraint β bestie, this is the exception object that gets thrown when a type constraint check fails. That's it, that's the whole job, and she does it flawlessly. π
Oh and fyi, when you type man on this one your terminal shows the page as MooseX...traint(3pm) because it ran out of room for the whole name. Rude of it honestly, but that's her. π¦
β¨ VERSION β¨
version 0.21 β periodt. π
πΈ SYNOPSIS πΈ
okay so here's the vibe in actual code, no cap:
use MooseX::Params::Validate qw( validated_list );
use Scalar::Util qw( blessed );
use Try::Tiny;
try {
my @p = validated_list( @_, foo => { isa => 'Str' } );
}
catch {
if (
blessed $_
&& $_->isa(
'MooseX::Params::Validate::Exception::ValidationFailedForTypeConstraint'
)
) {
...;
}
};
like, you run your validated_list, and if the type check goes sideways you catch it and check whether the thing you caught isa this class. If yes β congrats, it's her. π
π¦ DESCRIPTION π¦
This class provides information about type constraint failures. She's the little info packet that shows up when something you passed didn't match what the type constraint wanted. Not me being obsessed with an exception class but here we are. π
π METHODS π
This class provides the following methods:
$e->parameter()β returns a string describing the parameter. Like, something along the lines of"The 'foo' parameter"or"Parameter #1". It's giving "I know exactly which one of y'all did this". π₯$e->value()β this is the actual value that failed the type constraint check. The culprit. The main character of the crime. π$e->type()β this is the type constraint object that did not accept the value. She said no, respectfully. π
β STRINGIFICATION β
This object stringifies to a reasonable error message. So if you just print her or drop her in a string, she'll tell you what went wrong. No extra work required, slay. π«Ά
πΈ AUTHORS πΈ
- Stevan Little
<stevan@cpan.org> - Dave Rolsky
<autarch@urth.org>
Icons. Both of them. π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2013 - 2015 by Stevan Little <stevan@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page, bestie!! π this one came to you from perl v5.34.0, dated 2022-06-15, and your girl here is running on MooseX::Params::Validate version 0.21. mwah, go forth and validate. β¨π
π¦ where this page comes from
- debian bookworm: libmoosex-params-validate-perl 0.21-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmoosex-params-validate-perl 0.21-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmoosex-params-validate-perl 0.21-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmoosex-params-validate-perl 0.21-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmoosex-params-validate-perl 0.21-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms