Skip to content

Commit

Permalink
Issue #434
Browse files Browse the repository at this point in the history
Corretto messaggio di log in caso di errore PAG_014.
  • Loading branch information
pintorig committed Dec 9, 2021
1 parent ab72dca commit 53023a4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ private Response handleBaseException(UriInfo uriInfo, HttpHeaders httpHeaders, S
}

private Response handleGovpayException(UriInfo uriInfo, HttpHeaders httpHeaders, String methodName, GovPayException e, String transactionId) {
this.log.error("Errore ("+e.getClass().getSimpleName()+") durante "+methodName+": "+ e.getMessage(), e);
this.logMessageGovPayException(methodName, e);
FaultBean respKo = new FaultBean();
int statusCode = e.getStatusCode();
if(e.getFaultBean()!=null) {
Expand All @@ -232,6 +232,17 @@ private Response handleGovpayException(UriInfo uriInfo, HttpHeaders httpHeaders,
return handleResponseKo(responseBuilder, transactionId).build();
}

private void logMessageGovPayException(String methodName, GovPayException e) {
switch (e.getCodEsito()) {
case PAG_014:
this.log.info("Rilevata GovPayException durante l'esecuzione del metodo: "+methodName+", causa: "+ e.getCausa() + ", messaggio: " + e.getMessageV3());
break;
default:
this.log.error("Rilevata GovPayException durante l'esecuzione del metodo: "+methodName+", causa: "+ e.getCausa() + ", messaggio: " + e.getMessageV3(), e);
break;
}
}

private Response handleValidationException(UriInfo uriInfo, HttpHeaders httpHeaders, String methodName, ValidationException e, String transactionId) {
this.log.warn("Richiesta rifiutata per errori di validazione: " + e);
FaultBean respKo = new FaultBean();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ private Response handleBaseException(UriInfo uriInfo, HttpHeaders httpHeaders, S
}

private Response handleGovpayException(UriInfo uriInfo, HttpHeaders httpHeaders, String methodName, GovPayException e, String transactionId) {
this.log.error("Rilevata GovPayException durante l'esecuzione del metodo: "+methodName+", causa: "+ e.getCausa() + ", messaggio: " + e.getMessageV3(), e);
this.logMessageGovPayException(methodName, e);
FaultBean respKo = new FaultBean();
int statusCode = e.getStatusCode();
if(e.getFaultBean()!=null) {
Expand All @@ -235,6 +235,17 @@ private Response handleGovpayException(UriInfo uriInfo, HttpHeaders httpHeaders,

return handleResponseKo(responseBuilder, transactionId).build();
}

private void logMessageGovPayException(String methodName, GovPayException e) {
switch (e.getCodEsito()) {
case PAG_014:
this.log.info("Rilevata GovPayException durante l'esecuzione del metodo: "+methodName+", causa: "+ e.getCausa() + ", messaggio: " + e.getMessageV3());
break;
default:
this.log.error("Rilevata GovPayException durante l'esecuzione del metodo: "+methodName+", causa: "+ e.getCausa() + ", messaggio: " + e.getMessageV3(), e);
break;
}
}

private Response handleValidationException(UriInfo uriInfo, HttpHeaders httpHeaders, String methodName, ValidationException e, String transactionId) {
this.log.warn("Richiesta rifiutata per errori di validazione: " + e);
Expand Down

0 comments on commit 53023a4

Please sign in to comment.