View | Details | Raw Unified | Return to bug 28056
Collapse All | Expand All

(-)a/Koha/Exceptions/Patron.pm (-1 / +51 lines)
Lines 7-17 use Exception::Class ( Link Here
7
        description => "Something went wrong!"
7
        description => "Something went wrong!"
8
    },
8
    },
9
    'Koha::Exceptions::Patron::FailedDelete' => {
9
    'Koha::Exceptions::Patron::FailedDelete' => {
10
        isa         => 'Koha::Exceptions::Patron',
10
        description => "Deleting patron failed"
11
        description => "Deleting patron failed"
11
    },
12
    },
12
    'Koha::Exceptions::Patron::FailedDeleteAnonymousPatron' => {
13
    'Koha::Exceptions::Patron::FailedDeleteAnonymousPatron' => {
14
        isa         => 'Koha::Exceptions::Patron',
13
        description => "Deleting patron failed, AnonymousPatron is not deleteable"
15
        description => "Deleting patron failed, AnonymousPatron is not deleteable"
14
    },
16
    },
17
    'Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute' => {
18
        isa         => 'Koha::Exceptions::Patron',
19
        description => "Mandatory extended attribute missing",
20
        fields      => ['type']
21
    }
15
);
22
);
16
23
24
sub full_message {
25
    my $self = shift;
26
27
    my $msg = $self->message;
28
29
    unless ( $msg) {
30
        if ( $self->isa('Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute') ) {
31
            $msg = sprintf("Missing mandatory extended attribute (type=%s)", $self->type );
32
        }
33
    }
34
35
    return $msg;
36
}
37
38
=head1 NAME
39
40
Koha::Exceptions::Patron - Base class for patron exceptions
41
42
=head1 Exceptions
43
44
=head2 Koha::Exceptions::Patron
45
46
Generic patron exception.
47
48
=head2 Koha::Exceptions::Patron::FailedDelete
49
50
Deleting patron failed.
51
52
=head2 Koha::Exceptions::Patron::FailedDeleteAnonymousPatron
53
54
Tried to delete the anonymous patron.
55
56
=head2 Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute
57
58
A required mandatory extended attribute is missing.
59
60
=head1 Class methods
61
62
=head2 full_message
63
64
Overloaded method for exception stringifying.
65
66
=cut
67
17
1;
68
1;
18
- 

Return to bug 28056