Workflo...xception(3)
π Workflo...xception(3) β aka Workflow::Exception π
okay bestie, so this is a page from the User Contributed Perl Documentation, section 3, and the manual's short name is Workflo...xception(3) (yes the truncation is real, that's just how the header rolls). It's all about exception handling in Workflow. grab a boba, we're doing this π§β¨
πΈ NAME πΈ
Workflow::Exception β the base class for workflow exceptions. mother of all the lil exception babies π
β¨ VERSION β¨
This documentation describes version 2.09 of this package. periodt π
π SYNOPSIS π
# Standard usage
use Workflow::Exception qw( workflow_error );
my $user = $wf->context->param( 'current_user' );
unless ( $user->check_password( $entered_password ) ) {
workflow_error "User exists but password check failed";
}
# Pass a list of strings to form the message
unless ( $user->check_password( $entered_password ) ) {
workflow_error 'Bad login: ', $object->login_attempted;
}
# Using other exported shortcuts
use Workflow::Exception qw( configuration_error );
configuration_error "Field 'foo' must be a set to 'bar'";
use Workflow::Exception qw( validation_error );
validation_error "Validation for field 'foo' failed: $error";
π¦ DESCRIPTION π¦
first things first bestie: you should probably go look at Exception::Class for more usage examples, why we even use exceptions, what they're intended for, all of that. it's giving prerequisite reading π
so. this is the base class for all workflow exceptions. it declares a handful of exceptions and hands you shortcuts so that raising an exception is easier and way more readable. it's the glow-up your error handling deserved β¨
π METHODS π
throw( @msg, [ \%params ])
this one overrides throw() from Exception::Class to add a lil syntactic sugar. it's giving "let me make your life easier."
instead of this:
$exception_class->throw( message => 'This is my very long error message that I would like to pass',
param1 => 'Param1 value',
param2 => 'Param2 value' );
you can just do this:
$exception_class->throw( 'This is my very long error message ',
'that I would like to pass',
{ param1 => 'Param1 value',
param2 => 'Param2 value' } );
and everything works the exact same way. no cap. and when you combine it with the SHORTCUTS, the code gets so readable:
workflow_error "Something went horribly, terribly, dreadfully, "
"frightfully wrong: $@",
{ foo => 'bar' };
iconic behavior, honestly π«Ά
configuration_error
this method transforms the error into a configuration error.
this exception is thrown via </mythrow> when configuration of a workflow is unsuccessful. π
persist_error
this method transforms the error into a persistance error.
this exception is thrown via </mythrow> when the save of a workflow is unsuccessful.
validation_error
this method transforms the error into a validation error.
this exception is thrown via </mythrow> when input data or similar of a workflow is unsuccessful.
workflow_error
this method transforms the error into a workflow error.
this exception is thrown via </mythrow> when input data or similar of a workflow is unsuccessful.
π SHORTCUTS π
the whole point of these is that you import one lil name and get a whole exception class, iykyk:
Workflow::Exceptionβ import usingworkflow_errorWorkflow::Exception::Configurationβ import usingconfiguration_errorWorkflow::Exception::Persistβ import usingpersist_errorWorkflow::Exception::Validationβ import usingvalidation_error
β SEE ALSO β
Exception::Class
π COPYRIGHT π
Copyright (c) 2003-2021 Chris Winters. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Please see the LICENSE π
π AUTHORS π
Please see Workflow
and that's the whole page, bestie! it was generated for perl v5.42.0 on 2026-01-17 β so if you're reading this way in the future, hi, hope the vibe check passed π¦π slay, go raise some exceptions responsibly β¨
π¦ where this page comes from
- fedora 44: perl-Workflow 2.09-2.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms