|
Lines 55-60
use Exception::Class (
Link Here
|
| 55 |
description => 'Invalid data passed', |
55 |
description => 'Invalid data passed', |
| 56 |
fields => ['type', 'property', 'value'], |
56 |
fields => ['type', 'property', 'value'], |
| 57 |
}, |
57 |
}, |
|
|
58 |
'Koha::Exceptions::Object::NotInstantiated' => { |
| 59 |
isa => 'Koha::Exceptions::Object', |
| 60 |
description => 'Tried to access a method on an uninstantiated object', |
| 61 |
fields => ['class','method'] |
| 62 |
}, |
| 58 |
'Koha::Exceptions::Object::NotInStorage' => { |
63 |
'Koha::Exceptions::Object::NotInStorage' => { |
| 59 |
isa => 'Koha::Exceptions::Object', |
64 |
isa => 'Koha::Exceptions::Object', |
| 60 |
description => 'The object is not in storage yet', |
65 |
description => 'The object is not in storage yet', |
|
Lines 76-81
sub full_message {
Link Here
|
| 76 |
elsif ( $self->isa('Koha::Exceptions::Object::ReadOnlyProperty') ) { |
81 |
elsif ( $self->isa('Koha::Exceptions::Object::ReadOnlyProperty') ) { |
| 77 |
$msg = sprintf("Invalid attempt to change readonly property: %s", $self->property ); |
82 |
$msg = sprintf("Invalid attempt to change readonly property: %s", $self->property ); |
| 78 |
} |
83 |
} |
|
|
84 |
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 ); |
| 86 |
} |
| 79 |
} |
87 |
} |
| 80 |
|
88 |
|
| 81 |
return $msg; |
89 |
return $msg; |