in digital-document-service/src/main/java/com/epam/digital/data/platform/dgtldcmnt/exception/RestExceptionHandler.java [124:134]
public ResponseEntity<SystemErrorDto> handleMaxFileSizeExceeded(
MaxUploadSizeExceededException ex) {
var error = SystemErrorDto.builder()
.traceId(MDC.get(BaseRestExceptionHandler.TRACE_ID_KEY))
.code(FILE_SIZE_IS_TOO_LARGE_CODE)
.message(String.format("The size of the uploaded file exceeds %sMB",
digitalDocumentsProperties.getMaxFileSize().toMegabytes()))
.build();
log.error("File size is too large", ex);
return new ResponseEntity<>(error, HttpStatus.PAYLOAD_TOO_LARGE);
}