1 package Koha::Exception;
7 description => "Something went wrong!"
14 # If a message was passed manually, use it
15 return sprintf "Exception '%s' thrown '%s'\n", ref($self), $self->message
18 my $field_hash = $self->field_hash;
20 my $description = $self->description;
23 foreach my $key ( sort keys %$field_hash ) {
24 push @fields, $key . " => " . $field_hash->{$key}
25 if defined $field_hash->{$key};
29 sprintf "Exception '%s' thrown '%s'" . ( @fields ? " with %s" : "" ) . "\n",
30 ref($self), $description, ( @fields ? join ', ', @fields : () );
35 Koha::Exception - Base class for exceptions
39 =head2 Koha::Exception
47 Generic method for exception stringifying.