Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cwms-data-api/src/main/java/cwms/cda/ApiServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public void init() {
ctx.status(HttpServletResponse.SC_BAD_REQUEST).json(re);
})
.exception(Exception.class, (e, ctx) -> {
CdaError errResponse = new CdaError("System Error");
CdaError errResponse = new CdaError("System Error", Map.of("Error message", e.getMessage()));
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will escape unexpected oracle stack traces. Should trap specific exceptions, see https://github.com/USACE/cwms-data-api/blob/develop/cwms-data-api/src/main/java/cwms/cda/data/dao/RateDao.java#L169

logger.atWarning().withCause(e).log("error on request[%s]: %s",
errResponse.getIncidentIdentifier(), ctx.req.getRequestURI());
ctx.status(500);
Expand Down
Loading