#199 La méthode pour supprimer un titre est renommée et prend un id au lieu du modèle. Ajout d'un try catch sur artiste controller pour debugger l'ajout d'un artiste.
This commit is contained in:
@@ -81,8 +81,16 @@ public class ArtisteController : Controller
|
||||
Biographie = model.Biographie,
|
||||
};
|
||||
|
||||
// Persister les données.
|
||||
this.artisteRepository.Add(artiste);
|
||||
try
|
||||
{
|
||||
this.artisteRepository.Add(artiste);
|
||||
this.logger.LogInformation("Création d'un nouvel artiste: {Nom}", artiste.Nom);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.logger.LogError(ex, "Erreur lors de la création de l'artiste: {Nom}", artiste.Nom);
|
||||
return this.View(model);
|
||||
}
|
||||
|
||||
// Renvoyer sur la page Index.
|
||||
return this.RedirectToAction("Index");
|
||||
|
||||
Reference in New Issue
Block a user