Bug 20590: Koha::Exceptions::Exception
[koha.git] / Koha / Exceptions / Exception.pm
blob676858761331dafd26a74902097915fa9e1456bc
1 package Koha::Exceptions::Exception;
3 use Modern::Perl;
5 # Looks like this class should be more Koha::Exception::Base;
6 use Exception::Class (
7 'Koha::Exceptions::Exception' => {
8 description => "Something went wrong!"
9 },
12 # We want to overload it to have a stringification method for our exceptions
13 sub full_message {
14 my $self = shift;
16 my $msg = $self->message;
18 if ( $self->isa('Koha::Exceptions::Object::FKConstraint') ) {
19 $msg = sprintf("Invalid parameter passed, %s=%s does not exist", $self->broken_fk, $self->value );
22 return $msg;