MooseX::Params::Validate::Exception::ValidationFailedForTypeConstraint(3pm)

MooseX::Params::Validate::Exception::ValidationFailedForTypeConstraint3pm

Exception thrown when a type constraint check fails

Usage

    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'
            )
            ) {
            ...;
        }
    };

Version

version 0.21

Overview

This class provides information about type constraint failures.

Methods

This class provides the following methods:

$e->parameter()

This returns a string describing the parameter, something like "The 'foo' parameter" or "Parameter #1".

$e->value()

This is the value that failed the type constraint check.

$e->type()

This is the type constraint object that did not accept the value.

Stringification

This object stringifies to a reasonable error message.

Releases

5 releases since Debian 9 (Stretch); the text changed 2 times.

  1. 9–10
  2. 11
  3. 12–13

Authors

•

Stevan Little <[email protected]>

•

Dave Rolsky <[email protected]>

From libmoosex-params-validate-perl 0.21-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.