Specio::Exception(3)
π NAME π
This is the Specio::Exception(3) manual page, bestie β a User Contributed Perl Documentation moment β and the name is Specio::Exception, aka An exception class for type constraint failures. That's the whole name vibe: type constraint failure, exception class, slay. π
π VERSION π
version 0.49 β yes, that's the version, no cap. β¨
π¦ SYNOPSIS π¦
Here's the try/catch situation, bestie:
use Try::Tiny;
try {
$type->validate_or_die($value);
}
catch {
if ( $_->isa('Specio::Exception') ) {
print $_->message, "\n";
print $_->type->name, "\n";
print $_->value, "\n";
}
};
πΈ DESCRIPTION πΈ
So this exception class is thrown by Specio when a type check fails. It emulates the Throwable::Error API, but it doesn't use that module β the whole reason is to avoid adding a dependency on Moo. Lowkey iconic engineering choice, fr fr. π₯
π§ API π§
This class provides the following methods β collect them like little method PokΓ©mon:
π $exception->message π
The error message associated with the exception. That's the message, bestie. π
π $exception->stack_trace π
A Devel::StackTrace object for the exception. It's giving stack trace realness. π«Ά
π $exception->type π
The type constraint object against which the value failed. Yep, the actual type object that said "not today." π
π $exception->value π
The value that failed the type check. The audacity of this value, honestly. π
π $exception->as_string π
The exception as a string. This includes the method and the stack trace. So it's not just a vibe β it's a string with the method and the stack trace in it. β¨
π OVERLOADING π
This class overloads stringification to call the as_string method. So when you stringify one of these exceptions, it calls as_string. That's the whole overloading tea. π΅
π SUPPORT π
Bugs may be submitted at https://github.com/houseabsolute/Specio/issues. Not the cute kind of bugs, bestie β the GitHub issue kind. π
π SOURCE π
The source code repository for Specio can be found at https://github.com/houseabsolute/Specio. Go look, it's giving open source excellence. π
π AUTHOR π
Dave Rolsky <autarch@urth.org>. Iconic author behavior. π
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2012 - 2024 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. Read the license, bestie β it's important. π«Ά
That's the whole Specio::Exception(3) manual page, from perl v5.42.0, dated 2024-12-24. Now go validate something and slay π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Specio 0.490.0-160000.2.2 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms