diff --git a/EPAServeur/Controllers/FormationsApi.cs b/EPAServeur/Controllers/FormationsApi.cs index b9fe56e..f9df2b3 100644 --- a/EPAServeur/Controllers/FormationsApi.cs +++ b/EPAServeur/Controllers/FormationsApi.cs @@ -217,6 +217,10 @@ namespace IO.Swagger.Controllers { formationDTO = await formationService.GetFormationByIdAsync(idFormation); } + catch (ArgumentNullException) + { + logger.LogError("L'argument passé dans la requête pour récupérer une formation est invalide."); + } catch (FormationNotFoundException) { logger.LogError("Aucune formation ne correspond à l'id {idFormation} recherchée.", idFormation); @@ -229,14 +233,6 @@ namespace IO.Swagger.Controllers return NotFound(erreurDTO); } - catch (DbUpdateConcurrencyException) - { - logger.LogWarning("La formation {idFormation} n'a pas pu être récupérée car elle est prise par une autre ressource.", idFormation); - } - catch (DbUpdateException) - { - logger.LogError("Une erreur a eu lieu, la formation {idFormation} n'a pas pu être récupérée.", idFormation); - } catch (Exception) { logger.LogError("Une erreur inconnue est survenue lors de la récupération de la formation {idFormation}.", idFormation);