RoPkg:...eptions(3pm)
π RoPkg::Exceptions β the perl manpage, but make it cute β¨
okay bestie, this is RoPkg::Exceptions(3pm) from the User Contributed Perl Documentation corner of the internet, and we're about to have a whole moment about it. sit down, grab a strawberry π, let's go.
πΈ NAME πΈ
RoPkg::Exceptions β exceptions used by RoPkg packages π
β¨ DESCRIPTION β¨
So basically RoPkg::Exceptions is a collection of predefined exceptions used by all the modules from the RoPkg namespace. it's the shared emotional support exception library of the family, no cap π«Ά
π SYNOPSIS π
here's the vibe, verbatim, don't touch anything:
#!/usr/bin/perl
use strict;
use warnings;
use RoPkg::Exceptions;
sub main {
eval {
if ( $#ARGV == -1 ) {
Param::Missing->throw('No parameter found');
}
};
if ( my $e = Exception::Class->caught('Param::Missing') ) {
print STDERR $e->message,$/,$e->trace,$/;
}
}
main();
ngl, it is very possible that you don't find a good reason for using exceptions from this example. and you are right β this example is kind of silly π. but bestie, try to use exceptions in a real project. then you will apreciate their real value. trust. π₯
π¦ DEPENDENCIES π¦
RoPkg::Exceptions requires:
perl 5.008or later- the
Exception::Classmodule
that's it, that's the whole guest list β¨
π Exceptions List π
the following exceptions are defined in this class, and yes we're doing all of them:
Generalβ general pourpose exception πOutsideClassβ raised when a method is called outside a class instance πFileβ the base for all file related exceptions. this exception has thefilenameparameter, who can be used to specify the path to the file.filenameparameter can be used by all derivated exceptions. the following exceptions are derivated fromFile:File::NotFoundβ the file was not found πFile::Openβ error while opening file πFile::Createβ could not create file
Dirβ the base for all directory related exceptions. this exception has thedirnameparameter, who can be used to specify the path to the directory.dirnameparameter can be used by all derivated exceptions. the following exceptions are derivated fromDir:Dir::NotFoundβ the directory was not found πDir::Openβ error while opening directory πDir::Createβ could not create directory
Paramβ the base for all parameters related exceptions. this exception has thenameparameter, who can be used to specify the parameter name.namecan be used by all derivated exceptions. the following exceptions are derivated fromParam:Param::Missingβ the parameter was not foundParam::Unknownβ the parameter is unknownParam::Wrongβ the parameter has the wrong value or is not defined
DBβ the base for all database related exceptions. this exception has the following parameters:dsn,userandpass. this exception (and the ones derivated from her) are mostly used in RoPkg::DB class. of course, this doesn't means that you can't use them in your application ;) .The following exceptions are derivated fromDB:DB::Connectβ raised when the connection with the database could not be established πDB::ConnExistsβ raised when a connection with the same name already exists. π―DB::ConnNotFoundβ the requested connection was not foundDB::NoResultsβ the sql query returned no results π
π§ Exceptions Tree π§
look at the family tree, it's giving ancestral slay:
ROOT
General
OutsideClass
File
File::NotFound
File::Open
File::Create
Dir
Dir::NotFound
Dir::Open
Dir::Create
Param
Param::Missing
Param::Unknown
Param::Wrong
DB
DB::Connect
DB::ConnExists
DB::ConnNotFound
DB::NoResults
π SEE ALSO π
- RoPkg::Utils
go read that one too bestie, it's the sibling π
π AUTHOR π
Subredu Manuel <diablo@iasi.roedu.net> π
β VERSION β
the current version is 0.2.1 π
π₯ DIAGNOSTICS π₯
the tests for this module are located in t directory. to run those tests, use the following command:
make test
and then watch them pass. iconic behaviour only β¨
π SUBROUTINES/METHODS π
this module does not have any public methods. it's mysterious. it's lowkey main character energy. it simply is π¦
π«Ά INCOMPATIBILITIES π«Ά
None known to me π€·
π PERL CRITIC π
this module is perl critic level 1 compliant with 1 exception. so close to perfect, honestly relatable π
π BUGS AND LIMITATIONS π
No known bugs. if you find one (or many) please send me a detailed report. and bestie, be detailed, don't just say "it's broken" π
πΈ CONFIGURATION AND ENVIRONMENT πΈ
No configuration file or environment variables are used by this module. nothing to set up, nothing to export, just vibes β¨
π LICENSE AND COPYRIGHT π
Copyright (C) 2005 Subredu Manuel. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license. periodt. π
and that's the whole page, bestie π«Ά this was RoPkg::Exceptions(3pm), rendered by perl v5.32.1 on 2021-12-26. mwah π π
π¦ where this page comes from
- ubuntu jammy: libropkg-perl 0.4-1.4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms