private FaultCode CreateFaultCode(OiosiFaultCode faultCode, OiosiInnerFaultCode innerFaultCode) { switch (faultCode) { case OiosiFaultCode.Sender: FaultCode senderInnerFaultCode = CreateSenderFaultCode(innerFaultCode); return(FaultCode.CreateSenderFaultCode(senderInnerFaultCode)); case OiosiFaultCode.Receiver: FaultCode recieverInnerFaultCode = CreateRecieverFaultCode(innerFaultCode); return(FaultCode.CreateReceiverFaultCode(recieverInnerFaultCode)); default: throw new OiosiMessageFaultUnexpectedFaultCode(faultCode); } }
/// <summary> /// Constructor /// </summary> /// <param name="e">exception</param> /// <param name="faultCode">fault code</param> /// <param name="innerFaultCode">inner fault code</param> public OiosiMessageFault(Exception e, OiosiFaultCode faultCode, OiosiInnerFaultCode innerFaultCode) { StringBuilder reasonMessage = new StringBuilder(); Exception currentException = e; do { reasonMessage.Append(currentException.Message); if (currentException.InnerException != null) { reasonMessage.Append("\n"); } currentException = currentException.InnerException; } while (currentException != null); _reason = new FaultReason(reasonMessage.ToString()); _code = CreateFaultCode(faultCode, innerFaultCode); }
/// <summary> /// Constructor /// </summary> /// <param name="faultCode">The fault code</param> public OiosiMessageFaultUnexpectedFaultCode(OiosiFaultCode faultCode) : base(KeywordFromString.GetKeyword("faultcode", faultCode.ToString())) { }
/// <summary> /// Constructor /// </summary> /// <param name="oiosiFaultCode"></param> /// <param name="oiosiInnerFaultCode"></param> /// <param name="message">The message</param> public InterceptorChannelWrapperException(OiosiFaultCode oiosiFaultCode, OiosiInnerFaultCode oiosiInnerFaultCode, string message) : base(oiosiFaultCode, oiosiInnerFaultCode, CreatKeywords(message)) { }
/// <summary> /// Constructor /// </summary> /// <param name="innerException">The inner exception</param> public InterceptorChannelWrapperException(OiosiFaultCode oiosiFaultCode, OiosiInnerFaultCode oiosiInnerFaultCode, Exception innerException) : base(oiosiFaultCode, oiosiInnerFaultCode, CreatKeywords(innerException.Message)) { }
/// <summary> /// Constructor /// </summary> /// <param name="faultCode"></param> /// <param name="innerFaultCode"></param> /// <param name="message">The message</param> public InterceptorChannelException(OiosiFaultCode faultCode, OiosiInnerFaultCode innerFaultCode, string message) : base(message) { pFaultCode = faultCode; pInnerFaultCode = innerFaultCode; }
/// <summary> /// Constructor with faultcode and innerfaultcode /// </summary> /// <param name="faultCode">rasp message fault code</param> /// <param name="innerFaultCode">rasp message innerfault code</param> public InterceptorChannelException(OiosiFaultCode faultCode, OiosiInnerFaultCode innerFaultCode) : base() { pFaultCode = faultCode; pInnerFaultCode = innerFaultCode; }
/// <summary> /// Constructor /// </summary> /// <param name="innerException">The inner exception</param> public InterceptorChannelException(Exception innerException) : base(innerException) { pFaultCode = OiosiFaultCode.Receiver; pInnerFaultCode = OiosiInnerFaultCode.InternalSystemFailureFault; }
/// <summary> /// Constructor with faultcode, innerfaultcode, keywords and innerexception /// </summary> /// <param name="faultCode">rasp message fault code</param> /// <param name="innerFaultCode">rasp message innerfault code</param> /// <param name="keywords">keywords for the message</param> /// <param name="innerException">innerexception of the thrown exception</param> public InterceptorChannelException(OiosiFaultCode faultCode, OiosiInnerFaultCode innerFaultCode, System.Collections.Generic.Dictionary <string, string> keywords, System.Exception innerException) : base(keywords, innerException) { pFaultCode = faultCode; pInnerFaultCode = innerFaultCode; }
/// <summary> /// Constructor with faultcode, innerfaultcode and innerexception /// </summary> /// <param name="faultCode">rasp message fault code</param> /// <param name="innerFaultCode">rasp message innerfault code</param> /// <param name="innerException">innerexception of the thrown exception</param> public InterceptorChannelException(OiosiFaultCode faultCode, OiosiInnerFaultCode innerFaultCode, System.Exception innerException) : base(innerException) { pFaultCode = faultCode; pInnerFaultCode = innerFaultCode; }