Skip to content

CDA-115: Exception wrapping improvement#1775

Open
zack-rma wants to merge 2 commits into
USACE:developfrom
zack-rma:bugfix/location-alias-error-handling
Open

CDA-115: Exception wrapping improvement#1775
zack-rma wants to merge 2 commits into
USACE:developfrom
zack-rma:bugfix/location-alias-error-handling

Conversation

@zack-rma

@zack-rma zack-rma commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Updated JooqDao to wrap all DB exceptions in range 20,000 to 20,999. Included integration test for location groups.

Related Issue

Closes #1695

Validation

Integration test included.

Checklist

  • AI tools used

…Included integration test for location groups.
.assertThat()
.statusCode(is(HttpServletResponse.SC_BAD_REQUEST))
.body("message", equalTo("Bad Request"))
.body("details.message", equalTo("ORA-20998: ERROR: Alias (AliasedId) would reference multiple locations. " +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strip the "ORA-XXXX:" part out of the detail message. The context is fine, but the security people get all "wiggy" when hints of database implementations are present... even when it's already rather well known like for, you know, this project.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped error code

String[] parts = localizedMessage.split("\n");
String errorMessage = parts[0];
Map<String, String> errorDetails = new HashMap<>();
errorDetails.put("message", errorMessage);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message details need to be put through the sanitizer. The input is from the user so we assume it fail because it was an attack.... even if 98% of the time it's just a typo.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed message through sanitizer

@zack-rma zack-rma requested a review from MikeNeilson June 10, 2026 18:47
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.

Error code 500 when should be error code 400 for alias would reference multiple location issue

2 participants