.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "RoPkg::Exceptions 3pm" .TH RoPkg::Exceptions 3pm "2021-12-26" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" RoPkg::Exceptions \- exceptions used by RoPkg packages .SH "DESCRIPTION" .IX Header "DESCRIPTION" RoPkg::Exceptions is a collection of predefined exceptions used by all modules from RoPkg namespace. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& #!/usr/bin/perl \& \& use strict; \& use warnings; \& \& use RoPkg::Exceptions; \& \& sub main { \& eval { \& if ( $#ARGV == \-1 ) { \& Param::Missing\->throw(\*(AqNo parameter found\*(Aq); \& } \& }; \& \& if ( my $e = Exception::Class\->caught(\*(AqParam::Missing\*(Aq) ) { \& print STDERR $e\->message,$/,$e\->trace,$/; \& } \& } \& \& main(); .Ve .PP 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, try to use exceptions in a real project. Then, you will apreciate their real value. .SH "DEPENDENCIES" .IX Header "DEPENDENCIES" RoPkg::Exceptions require perl 5.008 or later and the Exception::Class module. .SH "Exceptions List" .IX Header "Exceptions List" The following exceptions are defined in this class: .IP "*) General \- general pourpose exception" 6 .IX Item "*) General - general pourpose exception" .PD 0 .IP "*) OutsideClass \- raised when a method is called outside a class instance" 6 .IX Item "*) OutsideClass - raised when a method is called outside a class instance" .IP "*) File \- the base for all file related exceptions . This exception has the \fBfilename\fR parameter, who can be used to specify the path to the file. \fBfilename\fR parameter can be used by all derivated exceptions. The following exceptions are derivated from File:" 6 .IX Item "*) File - the base for all file related exceptions . This exception has the filename parameter, who can be used to specify the path to the file. filename parameter can be used by all derivated exceptions. The following exceptions are derivated from File:" .RS 6 .IP "*) File::NotFound \- the file was not found" 3 .IX Item "*) File::NotFound - the file was not found" .IP "*) File::Open \- error while opening file" 3 .IX Item "*) File::Open - error while opening file" .IP "*) File::Create \- could not create file" 3 .IX Item "*) File::Create - could not create file" .RE .RS 6 .RE .IP "*) Dir \- the base for all directory related exceptions . This exception has the \fBdirname\fR parameter, who can be used to specify the path to the directory. \fBdirname\fR parameter can be used by all derivated exceptions. The following exceptions are derivated from Dir:" 6 .IX Item "*) Dir - the base for all directory related exceptions . This exception has the dirname parameter, who can be used to specify the path to the directory. dirname parameter can be used by all derivated exceptions. The following exceptions are derivated from Dir:" .RS 6 .IP "*) Dir::NotFound \- the directory was not found" 3 .IX Item "*) Dir::NotFound - the directory was not found" .IP "*) Dir::Open \- error while opening directory" 3 .IX Item "*) Dir::Open - error while opening directory" .IP "*) Dir::Create \- could not create directory" 3 .IX Item "*) Dir::Create - could not create directory" .RE .RS 6 .RE .IP "*) Param \- the base for all parameters related exceptions. This exception has the \fBname\fR parameter, who can be used to specify the parameter name. \fBname\fR can be used by all derivated exceptions. The following exceptions are derivated from Param:" 6 .IX Item "*) Param - the base for all parameters related exceptions. This exception has the name parameter, who can be used to specify the parameter name. name can be used by all derivated exceptions. The following exceptions are derivated from Param:" .RS 6 .IP "*) Param::Missing \- the parameter was not found" 3 .IX Item "*) Param::Missing - the parameter was not found" .IP "*) Param::Unknown \- the parameter is unknown" 3 .IX Item "*) Param::Unknown - the parameter is unknown" .IP "*) Param::Wrong \- the parameter has the wrong value or is not defined" 3 .IX Item "*) Param::Wrong - the parameter has the wrong value or is not defined" .RE .RS 6 .RE .IP "*) \s-1DB\s0 \- the base for all database related exceptions. This exception has the following parameters: \fBdsn\fR, \fBuser\fR and \fBpass\fR . 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 from \fI\s-1DB\s0\fR:" 6 .IX Item "*) DB - the base for all database related exceptions. This exception has the following parameters: dsn, user and pass . 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 from DB:" .RS 6 .IP "*) DB::Connect \- raised when the connection with the database could not be established" 4 .IX Item "*) DB::Connect - raised when the connection with the database could not be established" .IP "*) DB::ConnExists \- raised when a connection with the same name already exists." 4 .IX Item "*) DB::ConnExists - raised when a connection with the same name already exists." .IP "*) DB::ConnNotFound \- the requested connection was not found" 4 .IX Item "*) DB::ConnNotFound - the requested connection was not found" .IP "*) DB::NoResults \- the sql query returned no results" 4 .IX Item "*) DB::NoResults - the sql query returned no results" .RE .RS 6 .RE .PD .SH "Exceptions Tree" .IX Header "Exceptions Tree" .IP "\s-1ROOT\s0" 2 .IX Item "ROOT" .RS 2 .PD 0 .IP "General" 7 .IX Item "General" .IP "OutsideClass" 7 .IX Item "OutsideClass" .IP "File" 7 .IX Item "File" .RS 7 .IP "File::NotFound" 3 .IX Item "File::NotFound" .IP "File::Open" 3 .IX Item "File::Open" .IP "File::Create" 3 .IX Item "File::Create" .RE .RS 7 .RE .IP "Dir" 7 .IX Item "Dir" .RS 7 .IP "Dir::NotFound" 3 .IX Item "Dir::NotFound" .IP "Dir::Open" 3 .IX Item "Dir::Open" .IP "Dir::Create" 3 .IX Item "Dir::Create" .RE .RS 7 .RE .IP "Param" 7 .IX Item "Param" .RS 7 .IP "Param::Missing" 3 .IX Item "Param::Missing" .IP "Param::Unknown" 3 .IX Item "Param::Unknown" .IP "Param::Wrong" 3 .IX Item "Param::Wrong" .RE .RS 7 .RE .IP "\s-1DB\s0" 7 .IX Item "DB" .RS 7 .IP "DB::Connect" 4 .IX Item "DB::Connect" .IP "DB::ConnExists" 4 .IX Item "DB::ConnExists" .IP "DB::ConnNotFound" 4 .IX Item "DB::ConnNotFound" .IP "DB::NoResults" 4 .IX Item "DB::NoResults" .RE .RS 7 .RE .RE .RS 2 .RE .PD .SH "SEE ALSO" .IX Header "SEE ALSO" RoPkg::Utils .SH "AUTHOR" .IX Header "AUTHOR" Subredu Manuel .SH "VERSION" .IX Header "VERSION" The current version is 0.2.1 .SH "DIAGNOSTICS" .IX Header "DIAGNOSTICS" The tests for this module are located in \fBt\fR directory. To run those tests, use the following command: make test .SH "SUBROUTINES/METHODS" .IX Header "SUBROUTINES/METHODS" This module does not have any public methods. .SH "INCOMPATIBILITIES" .IX Header "INCOMPATIBILITIES" None known to me .SH "PERL CRITIC" .IX Header "PERL CRITIC" This module is perl critic level 1 compliant with 1 exception. .SH "BUGS AND LIMITATIONS" .IX Header "BUGS AND LIMITATIONS" No known bugs. If you find one (or many) please send me a detailed report. .SH "CONFIGURATION AND ENVIRONMENT" .IX Header "CONFIGURATION AND ENVIRONMENT" No configuration file or environment variables are used by this module. .SH "LICENSE AND COPYRIGHT" .IX Header "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 \s-1LICENSE\s0 file contains the full text of the license.