in src/main/java/com/epam/digital/data/platform/restapi/core/audit/ControllerAuditAspect.java [154:180]
private void prepareAndSendExceptionAudit(ResponseEntity<?> response,
AuditableException auditableException) {
var exceptionAuditEvent = new ExceptionAuditEvent();
String action;
if (auditableException.action().isBlank()) {
if (response.getBody() instanceof DetailedErrorResponse) {
action = ((DetailedErrorResponse) response.getBody()).getCode();
} else {
action = response.getStatusCode().getReasonPhrase();
}
} else {
action = auditableException.action();
}
exceptionAuditEvent.setAction(action);
EventType eventType;
if (httpStatusOfSecurityAudit.contains(response.getStatusCodeValue()) ||
responseCodeOfSecurityAudit.contains(action)) {
eventType = EventType.SECURITY_EVENT;
} else {
eventType = EventType.USER_ACTION;
}
exceptionAuditEvent.setEventType(eventType);
exceptionAuditEvent.setUserInfoEnabled(auditableException.userInfoEnabled());
restAuditEventsFacade.sendExceptionAudit(exceptionAuditEvent);
}