Skip to content

Commit

Permalink
Ajout log debug sur doi2ppn verbeux
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelQuetin committed Dec 9, 2024
1 parent a2275da commit 20b7e97
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/fr/abes/sudoc/controller/SudocController.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ public ResultWsDto printIdentifier2Ppn(@PathVariable String type, @PathVariable
@GetMapping(value = {"/doi_identifier_2_ppn"}, produces = MediaType.APPLICATION_JSON_VALUE)
public ResultWsDto doiIdentifier2Ppn(@RequestParam(name = "doi") String doi_identifier, @RequestParam(name = "provider") Optional<String> provider) throws IOException {
log.debug("DOI IDENTIFIER 2 PPN");
log.debug("RequestParam doi : {}, provider : {}", doi_identifier, provider);
ResultWsDto resultat = new ResultWsDto();
Optional<ElementDto> providerDto = this.providerService.getProviderDisplayName(provider);
log.debug("providerDto : {}", providerDto);
try {
IIdentifiantService service = factory.getService(TYPE_ID.DOI);
if (service.checkFormat(doi_identifier)) {
Expand All @@ -141,12 +143,14 @@ public ResultWsDto doiIdentifier2Ppn(@RequestParam(name = "doi") String doi_iden
feedResultatWithNotice(resultat, providerDto, ppn);
}
} else {
log.debug("DOI mauvais format {}", doi_identifier);
throw new IllegalArgumentException("Le DOI n'est pas au bon format");
}
} catch (IOException ex) {
log.error("Erreur dans la récupération de la notice correspondant au doi {}", doi_identifier);
throw new IOException(ex);
} catch (ZoneNotFoundException e) {
log.debug("ZoneNotFoundException : {}", e.getMessage());
throw new IOException(e.getMessage());
} catch (IllegalPpnException e) {
log.info("Aucune notice ne correspond au doi {}", doi_identifier);
Expand All @@ -168,6 +172,8 @@ private void feedResultatWithNotice(ResultWsDto resultat, Optional<ElementDto> p
} else {
resultat.addErreur("Le PPN " + notice.getPpn() + " n'est pas une ressource électronique");
}
} else {
log.debug("La notice est supprimée : {}", notice);
}
}

Expand Down

0 comments on commit 20b7e97

Please sign in to comment.