2026-06-25 01:46:21 +02:00
|
|
|
|
using BeWo.ServerUtils.Core;
|
2026-03-09 12:40:29 +01:00
|
|
|
|
using BS.Shared.Core;
|
2026-03-05 13:03:16 +01:00
|
|
|
|
using DevExpress.CodeParser.Diagnostics;
|
|
|
|
|
|
using log4net;
|
2025-03-19 09:35:01 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Configuration;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Runtime.Serialization;
|
|
|
|
|
|
using System.Runtime.Serialization.Json;
|
|
|
|
|
|
using System.ServiceModel;
|
|
|
|
|
|
using System.ServiceModel.Channels;
|
|
|
|
|
|
using System.ServiceModel.Dispatcher;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Xml;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BeWo.Service.ServiceBehavior.WCFError
|
|
|
|
|
|
{
|
|
|
|
|
|
public class WCFErrorHandler : IErrorHandler
|
|
|
|
|
|
{
|
2026-03-09 12:40:29 +01:00
|
|
|
|
private static readonly log4net.ILog log = LoggerUtils.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
2026-03-05 13:03:16 +01:00
|
|
|
|
|
2025-03-19 09:35:01 +01:00
|
|
|
|
public bool HandleError(Exception exception)
|
|
|
|
|
|
{
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ProvideFault(Exception error, MessageVersion version, ref Message message)
|
|
|
|
|
|
{
|
2025-06-13 11:37:19 +02:00
|
|
|
|
// Logge in File
|
2026-03-05 13:03:16 +01:00
|
|
|
|
log.Error(error);
|
2025-06-10 14:29:34 +02:00
|
|
|
|
|
2026-03-09 12:40:29 +01:00
|
|
|
|
var wcfError = Core.Utils.CreateBeWoFaultException(error);
|
2025-03-19 09:35:01 +01:00
|
|
|
|
|
|
|
|
|
|
var fault = wcfError.CreateMessageFault();
|
|
|
|
|
|
|
|
|
|
|
|
string action = OperationContext.Current.IncomingMessageHeaders.Action;
|
|
|
|
|
|
|
|
|
|
|
|
message = Message.CreateMessage(version, fault, action);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|