Skip to content

Commit

Permalink
gestion cas "Aucune notice ne correspond à la recherche"
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelQuetin committed Mar 28, 2024
1 parent d6193eb commit 10823aa
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import java.io.IOException;


@ControllerAdvice
@Order(Ordered.HIGHEST_PRECEDENCE)
@Slf4j
Expand Down Expand Up @@ -58,13 +59,16 @@ protected ResponseEntity<Object> handleHttpRequestMethodNotSupported(HttpRequest
@ExceptionHandler(ZoneNotFoundException.class)
protected ResponseEntity<Object> handleZoneNotFoundException(ZoneNotFoundException ex) {
String error = "Erreur dans la notice récupérée";
log.error(ex.getLocalizedMessage());
return buildResponseEntity(new ApiReturnError(HttpStatus.BAD_REQUEST, error, ex));
}


@ExceptionHandler(IOException.class)
protected ResponseEntity<Object> handleIOException(IOException ex) {
String error = "Erreur dans l'accès aux données";
return buildResponseEntity(new ApiReturnError(HttpStatus.NO_CONTENT, error, ex));
log.error(ex.getLocalizedMessage());
return buildResponseEntity(new ApiReturnError(HttpStatus.BAD_REQUEST, error, ex));
}

/**
Expand Down

0 comments on commit 10823aa

Please sign in to comment.