From f0fefff9956dbc9f84f5702af35f197c876d369a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 1 Feb 2023 12:19:13 +0100 Subject: [PATCH] Bug 32777: Display stack trace for REST API unhandled exception --- Koha/REST/Plugin/Exceptions.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Koha/REST/Plugin/Exceptions.pm b/Koha/REST/Plugin/Exceptions.pm index fd28d67e7f6..4d6adcf144c 100644 --- a/Koha/REST/Plugin/Exceptions.pm +++ b/Koha/REST/Plugin/Exceptions.pm @@ -21,6 +21,8 @@ use Scalar::Util qw( blessed ); use Mojo::Base 'Mojolicious::Plugin'; +use Devel::StackTrace; + =head1 NAME Koha::REST::Plugin::Exceptions @@ -68,7 +70,9 @@ sub register { my $message = "$method $path: unhandled exception $type\<\<$exception_string\>\>"; - $c->app->log->error( "$message" ); + my $trace = Devel::StackTrace->new->as_string; + + $c->app->log->error( "$message\n$trace"); $c->render( status => 500, -- 2.25.1