From 0b548fa338dc6d8237bde1bb8c5a118d2d7bc902 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 25 Mar 2024 14:42:02 -0400 Subject: [PATCH] Bug 36421: REST API 500 errors say to check the logs, but suppress errors that would be there If a REST auth error happens that that is unblessed or uncaught, we should warn the value to the logs. Test Plan: 1) Install the curbside pickups plugin 2) create a patron with the userid 'puser' and the cardnumber 'pcard' 3) GET /api/v1/contrib/curbsidepickup/patrons/XXX/pickups using basic auth with the username 'pcard' where XXX is the patron borrowernumber 4) Note there is no error in the logs 5) Apply this patch 6) Repeat step 3 7) You should now see an error in the logs! --- Koha/REST/V1/Auth.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Koha/REST/V1/Auth.pm b/Koha/REST/V1/Auth.pm index 948bed689bd..df4632875f0 100644 --- a/Koha/REST/V1/Auth.pm +++ b/Koha/REST/V1/Auth.pm @@ -95,6 +95,7 @@ sub under { } catch { unless (blessed($_)) { + warn $_; return $c->render( status => 500, json => { error => 'Something went wrong, check the logs.' } @@ -128,6 +129,7 @@ sub under { return $c->render(status => 500, json => { error => $_->error }); } else { + warn Data::Dumper::Dumper($_); return $c->render( status => 500, json => { error => 'Something went wrong, check the logs.' } -- 2.30.2