Bugzilla – Attachment 163856 Details for
Bug 36421
Better logging of 500 errors in V1/Auth.pm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36421: REST API 500 errors say to check the logs, but suppress errors that would be there
Bug-36421-REST-API-500-errors-say-to-check-the-log.patch (text/plain), 1.51 KB, created by
Kyle M Hall (khall)
on 2024-03-25 18:42:55 UTC
(
hide
)
Description:
Bug 36421: REST API 500 errors say to check the logs, but suppress errors that would be there
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2024-03-25 18:42:55 UTC
Size:
1.51 KB
patch
obsolete
>From 0b548fa338dc6d8237bde1bb8c5a118d2d7bc902 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36421
:
163856
|
163994
|
163995
|
164117