예제 #1
0
 private MessageFault BuildFault(Exception error)
 {
     ServiceExceptionDetail exceptionDetail = new ServiceExceptionDetail(error);
     FaultCode code = FaultCode.CreateReceiverFaultCode(ServiceExceptionDetail.FaultSubCodeName,
         ServiceExceptionDetail.FaultSubCodeNamespace);
     return MessageFault.CreateFault(code, new FaultReason(error.Message), exceptionDetail);
 }
예제 #2
0
        private MessageFault BuildFault(Exception error)
        {
            ServiceExceptionDetail exceptionDetail = new ServiceExceptionDetail(error);
            FaultCode code = FaultCode.CreateReceiverFaultCode(ServiceExceptionDetail.FaultSubCodeName,
                                                               ServiceExceptionDetail.FaultSubCodeNamespace);

            return(MessageFault.CreateFault(code, new FaultReason(error.Message), exceptionDetail));
        }
 public ServiceExceptionDetail(Exception ex)
     : base(ex)
 {
     this.AssemblyQualifiedName = ex.GetType().AssemblyQualifiedName;
     if (null != ex.InnerException)
     {
         this.InnerException = new ServiceExceptionDetail(ex.InnerException);
     }
 }
예제 #4
0
        public static Exception GetException(ServiceExceptionDetail exceptionDetail)
        {
            Type exceptionType = Type.GetType(exceptionDetail.AssemblyQualifiedName);

            if (null == exceptionDetail.InnerException)
            {
                return((Exception)Activator.CreateInstance(exceptionType, exceptionDetail.Message));
            }

            Exception innerException = GetException(exceptionDetail.InnerException);

            return((Exception)Activator.CreateInstance(exceptionType, exceptionDetail.Message, innerException));
        }