コード例 #1
0
        private MessageFault BuildFault(Exception error)
        {
            var exceptionDetail = new FaultMessage(error);
            var code            = FaultCode.CreateReceiverFaultCode(FaultMessage.FaultSubCodeName,
                                                                    FaultMessage.FaultSubCodeNamespace);

            return(MessageFault.CreateFault(code, new FaultReason(error.Message), exceptionDetail));
        }
コード例 #2
0
 public FaultMessage(Exception ex)
     : base(ex)
 {
     AssemblyQualifiedName = ex.GetType().AssemblyQualifiedName;
     if (null != ex.InnerException)
     {
         InnerException = new FaultMessage(ex.InnerException);
     }
 }
コード例 #3
0
        private Exception GetException(FaultMessage exceptionDetail)
        {
            if (null == exceptionDetail.InnerException)
            {
                return((Exception)Activator.CreateInstance(
                           Type.GetType(exceptionDetail.AssemblyQualifiedName),
                           exceptionDetail.Message));
            }

            var innerException = GetException(exceptionDetail.InnerException);

            return((Exception)Activator.CreateInstance(
                       Type.GetType(exceptionDetail.AssemblyQualifiedName),
                       exceptionDetail.Message, innerException));
        }