From 11fe2fb3e0c82a1b17b4b2de937cb04b70e28801 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 --- 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 0feb36a..3003e3a 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.7.4