File: Error.pm

package info (click to toggle)
courier-filter-perl 0.200%2Bds-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 412 kB
  • sloc: perl: 1,484; sh: 75; makefile: 9
file content (65 lines) | stat: -rw-r--r-- 1,208 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#
# Courier::Error class
#
# (C) 2003-2008 Julian Mehnle <julian@mehnle.net>
# $Id: Error.pm 210 2008-03-21 19:30:31Z julian $
#
###############################################################################

=head1 NAME

Courier::Error - Exception class for Perl modules related to the Courier MTA

=cut

package Courier::Error;

use warnings;
use strict;

use Error;

use base 'Error::Simple';

use constant TRUE   => (0 == 0);
use constant FALSE  => not TRUE;

=head1 SYNOPSIS

=head2 Exception handling

    use Error qw(:try);
    use Courier::Error;
    
    try {
        ...
        throw Courier::Error($error_message) if $error_condition;
        ...
    }
    catch Courier::Error with {
        ...
    };
    # See "Error" for more exception handling syntax.

=head2 Deriving new exception classes

    package Courier::Error::My;
    use base qw(Courier::Error);

=head1 DESCRIPTION

This class is a simple exception class for Perl modules related to the Courier
MTA.  See L<Error> for detailed instructions on how to use it.

=head1 SEE ALSO

For AVAILABILITY, SUPPORT, and LICENSE information, see
L<Courier::Filter::Overview>.

=head1 AUTHOR

Julian Mehnle <julian@mehnle.net>

=cut

TRUE;