Skip to content

Conversation

@kaladay
Copy link

@kaladay kaladay commented Dec 4, 2025

This brings in the following change sets:

  • #144 MODWRKFLOW-57: Prevent double-posting of Workflow.
  • #145 Improve exception handler to better return exceptions to caller in JSON.

kaladay and others added 17 commits November 24, 2025 15:00
This tells Spring Data Rest to utilize this field when implementing optimistic locking on entities.
The minimum length is 1, so a version must be supplied.

Provide `1.0` as the default.
Utilize `RepositoryEventHandler` annotation to pre-process the Workflow before creating.
Detect if the workflow already exists and if it does then throw an error.

Implement the error handling functionality.
Make sure this functionality is consistently being handled for all defined exceptions.

Perform this check relative to the version tag string to allow for different versions of the same UUID.
Make the logger static.

Remove `public` modifiers from unit tests.

Remove unnecessary `throws` on unit test.
The `openapi.xml` file is rebuilt using `mvn clean verify -P openapi`.
MODWRKFLOW-57: Prevent double-posting of Workflow.
This is a step-by-step style improvement where additional, better, improvements are expected to be made pending further investigation an analysis.

The controller advice itself is throwing exceptions, preventing the actual exceptions from being returned to the receiver.

Highlights:
  - Implement an abstract class that performs the exception logic.
  - Provide `ResponseEntity<String>` as the standard return type.
  - Relocate and rename the global exception handler as global advice.
  - Explicitly conver the `ResponseErrors` to a JSON string using `ObjectMapper`.
  - Remove deprecated use of explicit `Workflow.class` on `@RepositoryEventHandler`.
  - Rename `handleWorkflowCreate()` to `handleWorkflowBeforeCreate()`.
Pass the exception to the logger error will then allow it to print the stacktrace.
This is only done when debugging is enabled, so when debug is disabled pass NULL.
Improve exception handler to better return exceptions to caller in JSON.
@kaladay kaladay requested a review from a team December 4, 2025 18:58
@kaladay kaladay merged commit e9ccb48 into TAMULib:main Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants