Bugzilla – Attachment 126320 Details for
Bug 24609
Add routes for updating checkouts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24609: (QA follow-up) Cleaner handling of unhandled exceptions
Bug-24609-QA-follow-up-Cleaner-handling-of-unhandl.patch (text/plain), 1.42 KB, created by
Tomás Cohen Arazi
on 2021-10-15 11:51:31 UTC
(
hide
)
Description:
Bug 24609: (QA follow-up) Cleaner handling of unhandled exceptions
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2021-10-15 11:51:31 UTC
Size:
1.42 KB
patch
obsolete
>From cf3bcb8ccf061a5dba9f8aee8cd0dd9506b2a610 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 15 Oct 2021 08:46:33 -0300 >Subject: [PATCH] Bug 24609: (QA follow-up) Cleaner handling of unhandled > exceptions > >This patch updates how we handle unhandled exceptions nowadays in Koha >controllers. > >It also adds a missing call to ->discard_changes for the returned >object. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/REST/V1/Checkouts.pm | 13 ++----------- > 1 file changed, 2 insertions(+), 11 deletions(-) > >diff --git a/Koha/REST/V1/Checkouts.pm b/Koha/REST/V1/Checkouts.pm >index 1063ea264f..7b9d4502ea 100644 >--- a/Koha/REST/V1/Checkouts.pm >+++ b/Koha/REST/V1/Checkouts.pm >@@ -227,23 +227,14 @@ sub update { > my $params = $c->req->json; > $checkout->set_from_api( $params ); > $checkout->store(); >+ $checkout->discard_changes; > return $c->render( > status => 200, > openapi => $checkout->to_api > ); > } > catch { >- unless ( blessed $_ && $_->can('rethrow') ) { >- return $c->render( >- status => 500, >- openapi => { error => "Something went wrong, check Koha logs for details." } >- ); >- } >- >- return $c->render( >- status => 500, >- openapi => { error => "$_" } >- ); >+ $c->unhandled_exception($_); > }; > } > >-- >2.32.0
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 24609
:
98924
|
98925
|
99021
|
99022
|
115879
|
115880
|
115881
|
126191
|
126192
|
126193
|
126194
|
126316
|
126317
|
126318
|
126319
|
126320
|
126321
|
126917
|
126921
|
126922
|
126923
|
126924
|
126925
|
126926
|
126927
|
126928