This commit is contained in:
2026-03-05 13:03:16 +01:00
parent 49a745b936
commit eb2d3d2fcc
7 changed files with 26 additions and 14 deletions

View File

@@ -30,10 +30,12 @@ namespace BeWo.Service.ServiceBehavior.JsonError
public class JsonErrorHandler : IErrorHandler
{
private static readonly log4net.ILog log = ServiceLogger.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public void ProvideFault(Exception error, MessageVersion version, ref Message fault)
{
// Logge in File
ServiceLogger.JsonErrorLogger.LogError(error);
log.Error(error);
// Erstelle eine JSON-Fehlermeldung
var jsonError = new JsonError
@@ -44,7 +46,7 @@ namespace BeWo.Service.ServiceBehavior.JsonError
// Fügt StackTrace hinzu (AppSettings)
string val = ConfigurationManager.AppSettings["AdminServiceEnableStackTrace"];
if(bool.TryParse(val, out bool res) && res)
if (bool.TryParse(val, out bool res) && res)
{
jsonError.StackTrace = error.StackTrace;
}