From 04aac9898911f2d6ed89b59533b658272a45d5d1 Mon Sep 17 00:00:00 2001 From: jboinembalome Date: Tue, 3 Nov 2020 14:18:11 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20d'une=20exception=20suppl=C3=A9mentaire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EPAServeur/Controllers/FormationsApi.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/EPAServeur/Controllers/FormationsApi.cs b/EPAServeur/Controllers/FormationsApi.cs index 4ed3f3a..b9fe56e 100644 --- a/EPAServeur/Controllers/FormationsApi.cs +++ b/EPAServeur/Controllers/FormationsApi.cs @@ -101,6 +101,10 @@ namespace IO.Swagger.Controllers FormationDTO formation = await formationService.DeleteFormationByIdAsync(idFormation); } + catch (FormationIncompatibleIdException) + { + logger.LogError("Impossible de supprimer la formation car l'id de la formation passé en paramètre est null."); + } catch (FormationNotFoundException) { logger.LogError("Impossible de supprimer la formation d'id {idFormation} car elle n'existe pas.", idFormation); @@ -272,7 +276,7 @@ namespace IO.Swagger.Controllers try { - formations = await formationService.GetFormationRealiseeAsync(asc, numPage, parPAge, idAgence, texte, tri); + formations = await formationService.GetFormationRealiseesAsync(asc, numPage, parPAge, idAgence, texte, tri); } catch (ArgumentNullException) { @@ -622,7 +626,7 @@ namespace IO.Swagger.Controllers logger.LogInformation("Mise à jour de la formation d'id {idFormation}.", idFormation); FormationDTO formation = null; - + try { formation = await formationService.UpdateFormationAsync(idFormation, body);