void prepareAndSendExceptionAudit()

in src/main/java/com/epam/digital/data/platform/bphistory/service/api/audit/AuditEventProcessor.java [47:60]


  void prepareAndSendExceptionAudit(ResponseEntity<?> response) {
    var eventType = EventType.USER_ACTION;

    String action = response.getStatusCode().getReasonPhrase();
    if (response.getBody() instanceof DetailedErrorResponse) {
      action = ((DetailedErrorResponse) response.getBody()).getCode();
    }

    if (httpStatusOfSecurityAudit.contains(response.getStatusCodeValue()) ||
        responseCodeOfSecurityAudit.contains(action)) {
      eventType = EventType.SECURITY_EVENT;
    }
    restAuditEventsFacade.sendExceptionAudit(eventType, action);
  }