Perl Diver 2.31
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Error::TypeTiny::Assertion

Name Error::TypeTiny::Assertion
Version 1.004004
Located at /usr/share/perl5/vendor_perl
File /usr/share/perl5/vendor_perl/Error/TypeTiny/Assertion.pm
Is Core No
Search CPAN for this module Error::TypeTiny::Assertion
Documentation Error::TypeTiny::Assertion
Module Details Error::TypeTiny::Assertion


NAME

Error::TypeTiny::Assertion - exception when a value fails a type constraint


STATUS

This module is covered by the Type-Tiny stability policy.


DESCRIPTION

This exception is thrown when a value fails a type constraint assertion.

This package inherits from the Error::TypeTiny manpage; see that for most documentation. Major differences are listed below:

Attributes

type
The type constraint that was checked against. Weakened links are involved, so this may end up being undef.

value
The value that was tested.

varname
The name of the variable that was checked, if known. Defaults to '$_'.

attribute_name
If this exception was thrown as the result of an isa check or a failed coercion for a Moo attribute, then this will tell you which attribute (if your Moo is new enough).

(Hopefully one day this will support other OO frameworks.)

attribute_step
If this exception was thrown as the result of an isa check or a failed coercion for a Moo attribute, then this will contain either "isa check" or "coercion" to indicate which went wrong (if your Moo is new enough).

(Hopefully one day this will support other OO frameworks.)

Methods

has_type, has_attribute_name, has_attribute_step
Predicate methods.

message
Overridden to add varname to the message if defined.

explain
Attempts to explain why the value did not pass the type constraint. Returns an arrayref of strings providing step-by-step reasoning; or returns undef if no explanation is possible.


BUGS

Please report any bugs to http://rt.cpan.org/Dist/Display.html.


SEE ALSO

the Error::TypeTiny manpage.


AUTHOR

Toby Inkster <tobyink@cpan.org>.


COPYRIGHT AND LICENCE

This software is copyright (c) 2013-2014, 2017-2019 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


DISCLAIMER OF WARRANTIES

THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Perl Diver brought to you by ScriptSolutions.com © 1997- 2024