Mentions légales du service

Skip to content

Log exception messages

Dragonnier Tac requested to merge log_validation_error into develop

Simply add e.getMessage() into the logs of CustomRestExceptionHandler

This enables debugging of invalid messages: so we can get :

10371 [http-nio-8086-exec-2] ERROR f.g.s.r.w.e.CustomRestExceptionHandler - Validation failed for argument [0] in public org.springframework.http.ResponseEntity<fr.gouv.stopc.robertserver.ws.dto.ReportBatchResponseDto> fr.gouv.stopc.robertserver.ws.controller.impl.ReportControllerImpl.reportContactHistory(fr.gouv.stopc.robertserver.ws.vo.ReportBatchRequestVo) throws fr.gouv.stopc.robertserver.ws.exception.RobertServerException: [Field error in object 'reportBatchRequestVo' on field 'token': rejected value [null]; codes [NotNull.reportBatchRequestVo.token,NotNull.token,NotNull.java.lang.String,NotNull]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [reportBatchRequestVo.token,token]; arguments []; default message [token]]; default message [must not be null]]  
10371 [http-nio-8086-exec-2] ERROR f.g.s.r.w.e.CustomRestExceptionHandler - Invalid data 

instead of only

10371 [http-nio-8086-exec-2] ERROR f.g.s.r.w.e.CustomRestExceptionHandler - Invalid data 

Merge request reports