From 2918cc9c2712d5b658a207b15dcd63718b8f952e Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Tue, 7 Mar 2017 13:37:09 +0200 Subject: [PATCH] Bug 18137: (follow-up) Fix handling DBIx::Class::Exception messages - DBIx::Class::Exception should use ->{msg} Signed-off-by: Josef Moravec Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- Koha/REST/V1/Cities.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Koha/REST/V1/Cities.pm b/Koha/REST/V1/Cities.pm index 0feb36a471..3003e3aefe 100644 --- a/Koha/REST/V1/Cities.pm +++ b/Koha/REST/V1/Cities.pm @@ -42,7 +42,7 @@ sub list { catch { if ( $_->isa('DBIx::Class::Exception') ) { return $c->render( status => 500, - openapi => { error => $_->msg } ); + openapi => { error => $_->{msg} } ); } else { return $c->render( status => 500, @@ -76,7 +76,7 @@ sub add { catch { if ( $_->isa('DBIx::Class::Exception') ) { return $c->render( status => 500, - openapi => { error => $_->message } ); + openapi => { error => $_->{msg} } ); } else { return $c->render( status => 500, @@ -131,7 +131,7 @@ sub delete { } elsif ( $_->isa('DBIx::Class::Exception') ) { return $c->render( status => 500, - openapi => { error => $_->msg } ); + openapi => { error => $_->{msg} } ); } else { return $c->render( status => 500, -- 2.39.5