From c1a48301c581cd9cc7b0bd7e906c9094107063d0 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} --- 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