blib/lib/Mail/Log/Exceptions.pm

filter: Statementstmt 100% 14 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 18 / 18 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
↑ Summary
1 #!/usr/bin/perl
2  
3 package Mail::Log::Exceptions;
4  
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 $VERSION = '1.0200';
9 2 ▶use Exception::Class ( 'Mail::Log::Exceptions'
Subroutine BEGIN: called CC=1 SCAR=0.0
10 => { description => 'A generic Mail::Log::Exception.'}
11 ,
12
13 'Mail::Log::Exceptions::InvalidParameter'
14 => { description => 'A parameter that was passed to a method is invalid.'
15 , isa => 'Mail::Log::Exceptions'
16 },
17
18 'Mail::Log::Exceptions::Unimplemented'
19 => { description => 'Stuff that should be implemented by subclasses.'
20 , isa => 'Mail::Log::Exceptions'
21 },
22
23 'Mail::Log::Exceptions::LogFile'
24 => { description => 'An error with the logfile.'
25 , isa => 'Mail::Log::Exceptions'
26 },
27
28 'Mail::Log::Exceptions::Message'
29 => { description => 'An error with the message info.'
30 , isa => 'Mail::Log::Exceptions'
31 },
32
33 'Mail::Log::Exceptions::Message::IncompleteLog'
34 => { description => 'Message was not fully in this log.'
35 , isa => 'Mail::Log::Exceptions::Message'
36 },
37 2 );
38  
39  
40 2 1;
41  
42  
43 =head1 NAME
44  
45 Mail::Log::Exceptions - Exceptions for the Mail::Log::* modules.
46  
47 =head1 SYNOPSIS
48  
49 use Mail::Log::Exceptions;
50  
51 Mail::Log::Exceptions->throw(q{Error description});
52  
53 =head1 DESCRIPTION
54  
55 This is a generic Exceptions module, supporting exceptions for the Mail::Log::*
56 modules. At the moment it's just a thin wrapper around L<Exception::Class>,
57 with appropriate class names for this use.
58  
59 Current exceptions in this module:
60  
61 =over 4
62  
63 =item Mail::Log::Exceptions
64  
65 The root level Exception class. Generic: Avoid using.
66  
67 =item Mail::Log::Exceptions::InvalidParameter
68  
69 Errors due to passing the data types, not passing required data, or other
70 mistakes in calling method.
71  
72 =item Mail::Log::Exceptions::Unimplemented
73  
74 Exception to be thrown when a called method has not been implimented. Typically
75 used by base classes when defining a method for subclasses to override.
76  
77 =item Mail::Log::Exceptions::Logfile
78  
79 Errors having to do with the logfile itself: Errors opening, reading, etc.
80  
81 =item Mail::Log::Exceptions::Message
82  
83 Errors having to do with message information: Something is unreadable, or
84 missing, or in bad format, etc.
85  
86 =item Mail::Log::Exceptions::Message::IncompleteLog
87  
88 Errors due to there being a logfile that is incomplete, or a message that is not
89 entirely within this logfile.
90  
91 =back
92  
93 Classes in the module tree may define sub-classes of the above exceptions.
94  
95 =head1 USAGE
96  
97 See L<Exception::Class>
98  
99 =head1 REQUIRES
100  
101 L<Exception::Class>
102  
103 =head1 AUTHOR
104  
105 Daniel T. Staal
106  
107 DStaal@usa.net
108  
109 =head1 SEE ALSO
110  
111 L<Exception::Class>
112  
113 =head1 HISTORY
114  
115 Nov 22, 2008 - Added
116  
117 Oct 9, 2008 - Inital version.
118  
119 =head1 COPYRIGHT and LICENSE
120  
121 Copyright (c) 2008 Daniel T. Staal. All rights reserved.
122 This program is free software; you can redistribute it and/or
123 modify it under the same terms as Perl itself.
124  
125 This copyright will expire in 30 years, or 5 years after the author's
126 death, whichever is longer.
127  
128 =cut
↑ Summary