@@ -, +, @@ die("Nada"); before the render step. use Koha::Exceptions; Koha::Exceptions::DuplicateObject->throw("Nada"); environment --- Koha/REST/Plugin/Exceptions.pm | 3 ++- Koha/REST/V1.pm | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) --- a/Koha/REST/Plugin/Exceptions.pm +++ a/Koha/REST/Plugin/Exceptions.pm @@ -69,7 +69,8 @@ sub register { my $message = "$method $path: unhandled exception $type\<\<$exception_string\>\>"; - $c->app->log->error("$message"); + my $logger = Koha::Logger->get({ interface => 'api' }); + $logger->error("$message"); $c->render( status => 500, --- a/Koha/REST/V1.pm +++ a/Koha/REST/V1.pm @@ -40,8 +40,6 @@ Overloaded Mojolicious->startup method. It is called at application startup. sub startup { my $self = shift; - $self->log( Koha::Logger->get({ interface => 'api' }) ); - $self->hook( before_dispatch => sub { my $c = shift; @@ -63,7 +61,6 @@ sub startup { $self->types->type( mij => 'application/marc-in-json' ); $self->types->type( marc => 'application/marc' ); - my $secret_passphrase = C4::Context->config('api_secret_passphrase'); if ($secret_passphrase) { $self->secrets([$secret_passphrase]); --