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;
status => 404,
openapi => { error => $_->error }
);
}
if ( $_->isa('Koha::Exceptions::UnsupportedMediaType') ) {
return $c->render(
status => 415,
description: Package not found
schema:
$ref: "../swagger.yaml#/definitions/error"
415:
description: Unsupported Media Type
500:
description: |-
Internal server error. Possible `error_code` attribute values:
-