예제 #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);
     }
 }
        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));
        }