|
Lines 23-28
use Exception::Class (
Link Here
|
| 23 |
'Koha::Exceptions::Object' => { |
23 |
'Koha::Exceptions::Object' => { |
| 24 |
isa => 'Koha::Exceptions::Exception', |
24 |
isa => 'Koha::Exceptions::Exception', |
| 25 |
}, |
25 |
}, |
|
|
26 |
'Koha::Exceptions::Object::CannotBeDeleted' => { |
| 27 |
isa => 'Koha::Exceptions::Object', |
| 28 |
description => 'The object cannot be deleted', |
| 29 |
fields => ['object', 'reason'], |
| 30 |
}, |
| 26 |
'Koha::Exceptions::Object::DuplicateID' => { |
31 |
'Koha::Exceptions::Object::DuplicateID' => { |
| 27 |
isa => 'Koha::Exceptions::Object', |
32 |
isa => 'Koha::Exceptions::Object', |
| 28 |
description => "Duplicate ID passed", |
33 |
description => "Duplicate ID passed", |
|
Lines 84-89
sub full_message {
Link Here
|
| 84 |
elsif ( $self->isa('Koha::Exceptions::Object::NotInstantiated') ) { |
89 |
elsif ( $self->isa('Koha::Exceptions::Object::NotInstantiated') ) { |
| 85 |
$msg = sprintf("Tried to access the '%s' method, but %s is not instantiated", $self->method, $self->class ); |
90 |
$msg = sprintf("Tried to access the '%s' method, but %s is not instantiated", $self->method, $self->class ); |
| 86 |
} |
91 |
} |
|
|
92 |
elsif ( $self->isa('Koha::Exceptions::Object::CannotBeDeleted') ) { |
| 93 |
$msg = sprintf("Cannot delete %s object (id=%s). Reason: %s", $self->object->_get_object_class, $self->object->id, $self->reason ); |
| 94 |
} |
| 87 |
} |
95 |
} |
| 88 |
|
96 |
|
| 89 |
return $msg; |
97 |
return $msg; |