Eureka sprint 1 staging - #226
Merged
Merged
Conversation
kaladay
commented
Jul 17, 2026
Collaborator
- Issue 223: Improve error handling and processing of OKAPI response.
This should already work when replacing the **OKAPI** **URL** with the **KONG** **URL**. However, the error handling/reporting (and lack thereof) has made the process confusing and more problematic. These changes help improve the design to improve the ability to investigate and handle problems with migrating to other services like **KONG**. Ensure the **OKAPI** (or now **KONG**) response is in a separate `try..catch..` statement. This will help properly identify and report problems with communicating to **OKAPI**. Bring in the controller advice and similar functionality from other repositories, like **IBIS**. This provides an actual response to the user on error. Previously an error would result in no response on curl commands. This is confusing and not ideal. This also brings in the response **JSON** structure from **IBIS**. **IBIS** uses **Java** record types, but that is not available for this repository because **Java** records are not supported in **Java 11**. Implement this as a class with getters and setters. Break apart the **HTTP** client and server errors into explicit exceptions so that they may be more explicitly handled. Add and improve relevant NULL pointer checks in the **FOLIO** catalog service class. In particular, the `response.hasBody()` check could fail because `response` could be NULL. Then the `response.getBody()` can return NULL, so just check that for NULL directly rather than calling a function `hasBody()` to effectuate the NULL check. Repeat this logic for the `isArray()` call. Remove unnecessary `.toString()` call. Prevent NULL pointer problems in `getDate()` with `input` by adding an explicit check. The unit test structure is changed to handle the new behavior where a separate request to **OKAPI** is being made. Disabling the trimming of the stack traces in exceptions so that unit test failures can be better interpreted.
…reka Issue 223: Improve error handling and processing of OKAPI response.
Coverage Report for CI Build 29765155955Coverage decreased (-1.0%) to 62.081%Details
Uncovered Changes
Coverage Regressions21 previously-covered lines in 2 files lost coverage.
Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.