From fc521b1dec1c080efa47e04d4ea640e18e581246 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Tue, 7 Mar 2017 13:37:09 +0200 Subject: [PATCH] [SIGNED-OFF] Bug 18137: (follow-up) Fix handling DBIx::Class::Exception messages - DBIx::Class::Exception should use ->{msg} Signed-off-by: Josef Moravec --- 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.1.4