Bugzilla – Attachment 149440 Details for
Bug 33482
Errors from EBSCO's ws are not reported to the UI
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33482: Unsupported Media Type exception in packages patch method
Bug-33482-Unsupported-Media-Type-exception-in-pack.patch (text/plain), 2.50 KB, created by
Pedro Amorim
on 2023-04-11 12:47:05 UTC
(
hide
)
Description:
Bug 33482: Unsupported Media Type exception in packages patch method
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-04-11 12:47:05 UTC
Size:
2.50 KB
patch
obsolete
>From d76d42841095945d3044f43bce0ec9fac3482e76 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Tue, 11 Apr 2023 12:45:13 +0000 >Subject: [PATCH] Bug 33482: Unsupported Media Type exception in packages patch > method > >This adds the Unsupported Media Type exception error code >and error message to the UI >--- > Koha/ERM/Providers/EBSCO.pm | 2 ++ > Koha/REST/V1/ERM/EHoldings/Packages/EBSCO.pm | 7 ++++++- > api/v1/swagger/paths/erm_eholdings_packages.yaml | 4 ++++ > 3 files changed, 12 insertions(+), 1 deletion(-) > >diff --git a/Koha/ERM/Providers/EBSCO.pm b/Koha/ERM/Providers/EBSCO.pm >index 38217b5fa29..6aa848a7ff9 100644 >--- a/Koha/ERM/Providers/EBSCO.pm >+++ b/Koha/ERM/Providers/EBSCO.pm >@@ -277,6 +277,8 @@ sub request { > Koha::Exceptions::ObjectNotFound->throw($message); > } elsif ( $response->code == 401 ) { > Koha::Exceptions::Authorization::Unauthorized->throw($message); >+ } elsif ( $response->code == 415 ) { >+ Koha::Exceptions::UnsupportedMediaType->throw($message); > } else { > die sprintf "ERROR requesting EBSCO API\n%s\ncode %s: %s\n", $url, $response->code, > $message; >diff --git a/Koha/REST/V1/ERM/EHoldings/Packages/EBSCO.pm b/Koha/REST/V1/ERM/EHoldings/Packages/EBSCO.pm >index 8c65c087064..fd2ea9315b0 100644 >--- a/Koha/REST/V1/ERM/EHoldings/Packages/EBSCO.pm >+++ b/Koha/REST/V1/ERM/EHoldings/Packages/EBSCO.pm >@@ -151,7 +151,12 @@ sub edit { > status => 404, > openapi => { error => $_->error } > ); >- >+ } >+ if ( $_->isa('Koha::Exceptions::UnsupportedMediaType') ) { >+ return $c->render( >+ status => 415, >+ openapi => { error => $_->error } >+ ); > } > } > >diff --git a/api/v1/swagger/paths/erm_eholdings_packages.yaml b/api/v1/swagger/paths/erm_eholdings_packages.yaml >index 51899e33162..ace0674cdc2 100644 >--- a/api/v1/swagger/paths/erm_eholdings_packages.yaml >+++ b/api/v1/swagger/paths/erm_eholdings_packages.yaml >@@ -391,6 +391,10 @@ > description: Package not found > schema: > $ref: "../swagger.yaml#/definitions/error" >+ 415: >+ description: Unsupported Media Type >+ schema: >+ $ref: "../swagger.yaml#/definitions/error" > 500: > description: |- > Internal server error. Possible `error_code` attribute values: >-- >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 33482
:
149435
|
149439
|
149440
|
149450
|
149508
|
150292