public ResponseEntity handleRestSystemException()

in src/main/java/com/epam/digital/data/platform/starter/errorhandling/BaseRestExceptionHandler.java [99:108]


  public ResponseEntity<SystemErrorDto> handleRestSystemException(RestSystemException ex) {
    var error = SystemErrorDto.builder()
        .traceId(MDC.get(TRACE_ID_KEY))
        .code(ex.getCode())
        .message(ex.getMessage())
        .localizedMessage(ex.getLocalizedMessage())
        .build();
    log.error("Error occurs in internal REST communication", ex);
    return new ResponseEntity<>(error, ex.getHttpStatus());
  }