Skip to content

Commit

Permalink
fix: Uat
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenzo-ingenito committed Apr 14, 2024
1 parent b7a518f commit 199dc49
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import it.finanze.sanita.fse2.ms.gtw.dispatcher.config.MicroservicesURLCFG;
import it.finanze.sanita.fse2.ms.gtw.dispatcher.dto.response.ErrorResponseDTO;
import it.finanze.sanita.fse2.ms.gtw.dispatcher.dto.response.TransactionInspectResDTO;
import it.finanze.sanita.fse2.ms.gtw.dispatcher.enums.ErrorInstanceEnum;
import it.finanze.sanita.fse2.ms.gtw.dispatcher.enums.RestExecutionResultEnum;
import it.finanze.sanita.fse2.ms.gtw.dispatcher.exceptions.BusinessException;
import it.finanze.sanita.fse2.ms.gtw.dispatcher.exceptions.NoRecordFoundException;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -89,7 +91,11 @@ private void errorHandler(final HttpStatusCodeException e1) {

// 404 Not found.
if (HttpStatus.NOT_FOUND.equals(e1.getStatusCode())) {
ErrorResponseDTO error = ErrorResponseDTO.builder().detail("No Record Found").build();
ErrorResponseDTO error = ErrorResponseDTO.builder().
type(RestExecutionResultEnum.RECORD_NOT_FOUND.getType()).
title(RestExecutionResultEnum.RECORD_NOT_FOUND.getTitle()).
instance(ErrorInstanceEnum.RECORD_NOT_FOUND.getInstance()).
detail("No Record Found").build();
throw new NoRecordFoundException(error);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ protected ResponseEntity<ErrorResponseDTO> handleServerResponseException(ServerR
protected ResponseEntity<ErrorResponseDTO> handleRecordNotFoundException(NoRecordFoundException ex, final WebRequest request) {
log.error("" , ex);
Integer status = 404;

LogTraceInfoDTO traceInfoDto = getLogTraceInfo();
String detail = ExceptionUtils.getMessage(ex);
if(ex.getError()!=null) {
detail = ex.getError().getDetail();
}
ErrorResponseDTO out = new ErrorResponseDTO(getLogTraceInfo(), RestExecutionResultEnum.RECORD_NOT_FOUND.getType(), RestExecutionResultEnum.RECORD_NOT_FOUND.getTitle(), detail , status, ErrorInstanceEnum.RECORD_NOT_FOUND.getInstance());
ErrorResponseDTO out = new ErrorResponseDTO(traceInfoDto, RestExecutionResultEnum.RECORD_NOT_FOUND.getType(), RestExecutionResultEnum.RECORD_NOT_FOUND.getTitle(), detail , status, ErrorInstanceEnum.RECORD_NOT_FOUND.getInstance());
if(ex.getError()!=null) {
out = ex.getError();
detail = ex.getError().getDetail();
}
out.setSpanID(traceInfoDto.getSpanID());
out.setTraceID(traceInfoDto.getTraceID());

HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_PROBLEM_JSON);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class AccreditamentoSimulationSRV implements IAccreditamentoSimulationSRV
public AccreditamentoSimulationDTO runSimulation(final String idDocumento, final byte[] pdf, final EventTypeEnum eventType) {
AccreditamentoSimulationDTO output = null;

if(EventTypeEnum.REPLACE.equals(eventType)) {
if(EventTypeEnum.REPLACE.equals(eventType) && !idDocumento.equals("TRIAL_ID_SKIP_ACCREDITATIONCHECK")) {
statusCheckClient.callSearchEventByIdDocumento(idDocumento);
}

Expand Down

0 comments on commit 199dc49

Please sign in to comment.