![]() |
![]()
| ![]() |
![]()
NAMESpecio::Exception - An exception class for type constraint failures VERSIONversion 0.51 SYNOPSISuse Try::Tiny; try { $type->validate_or_die($value); } catch { if ( $_->isa('Specio::Exception') ) { print $_->message, "\n"; print $_->type->name, "\n"; print $_->value, "\n"; } }; DESCRIPTIONThis exception class is thrown by Specio when a type check fails. It emulates the Throwable::Error API, but doesn't use that module to avoid adding a dependency on Moo. APIThis class provides the following methods: $exception->messageThe error message associated with the exception. $exception->stack_traceA Devel::StackTrace object for the exception. $exception->typeThe type constraint object against which the value failed. $exception->valueThe value that failed the type check. $exception->as_stringThe exception as a string. This includes the method and the stack trace. OVERLOADINGThis class overloads stringification to call the "as_string" method. SUPPORTBugs may be submitted at <https://github.com/houseabsolute/Specio/issues>. SOURCEThe source code repository for Specio can be found at <https://github.com/houseabsolute/Specio>. AUTHORDave Rolsky <autarch@urth.org> COPYRIGHT AND LICENSEThis software is Copyright (c) 2012 - 2025 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) The full text of the license can be found in the LICENSE file included with this distribution.
|