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)); }
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)); }