#199 : Test de correction pour postgre.
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
using Npgsql;
|
||||
|
||||
using Webzine.EntitiesContext;
|
||||
using Webzine.Entity;
|
||||
using Webzine.Repository.Contracts;
|
||||
@@ -38,7 +40,19 @@ public class DbCommentaireRepository : ICommentaireRepository
|
||||
}
|
||||
catch (DbUpdateException dbex)
|
||||
{
|
||||
this.logger.LogError(dbex, "Erreur de base de données lors de l'ajout du commentaire de l'auteur : {Auteur}", commentaire?.Auteur);
|
||||
PostgresException? postgresException = dbex.InnerException as PostgresException;
|
||||
|
||||
this.logger.LogError(
|
||||
dbex,
|
||||
"Erreur de base de données lors de l'ajout du commentaire. Auteur: {Auteur} | IdTitre: {IdTitre} | DateCreation: {DateCreation:o} | PostgresCode: {PostgresCode} | Detail: {Detail} | Constraint: {Constraint} | Column: {Column} | Table: {Table}",
|
||||
commentaire?.Auteur,
|
||||
commentaire?.IdTitre,
|
||||
commentaire?.DateCreation,
|
||||
postgresException?.SqlState,
|
||||
postgresException?.Detail,
|
||||
postgresException?.ConstraintName,
|
||||
postgresException?.ColumnName,
|
||||
postgresException?.TableName);
|
||||
throw;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user