• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

TAMULib / CatalogService / 27629250618

16 Jun 2026 03:23PM UTC coverage: 62.081% (-1.0%) from 63.032%
27629250618

Pull #224

github

kaladay
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.
Pull Request #224: Issue 223: Improve error handling and processing of OKAPI response.

116 of 206 new or added lines in 7 files covered. (56.31%)

21 existing lines in 2 files now uncovered.

889 of 1432 relevant lines covered (62.08%)

0.62 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.0
/service/src/main/java/edu/tamu/catalog/exception/CatalogHttpClientException.java


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc