public static WcfServiceFault CreateWcfServiceFault(Exception ex)
		{
			WcfServiceFault fault = new WcfServiceFault() { Message = ex.Message, Source = ex.Source, Target = ex.TargetSite.ToString() };
			if (null != ex.InnerException)
			{
				WcfServiceFault wrapper = fault;
				Exception te = ex.InnerException;
				while (null != te)
				{
					wrapper.Inner = new WcfServiceFault() { Message = te.Message, Source = te.Source, Target = te.TargetSite.ToString() };
					te = te.InnerException;
					wrapper = wrapper.Inner;
				}
			}
			return fault;
		}
Exemple #2
0
        public static WcfServiceFault CreateWcfServiceFault(Exception ex)
        {
            WcfServiceFault fault = new WcfServiceFault()
            {
                Message = ex.Message, Source = ex.Source, Target = ex.TargetSite.ToString()
            };

            if (null != ex.InnerException)
            {
                WcfServiceFault wrapper = fault;
                Exception       te      = ex.InnerException;
                while (null != te)
                {
                    wrapper.Inner = new WcfServiceFault()
                    {
                        Message = te.Message, Source = te.Source, Target = te.TargetSite.ToString()
                    };
                    te      = te.InnerException;
                    wrapper = wrapper.Inner;
                }
            }
            return(fault);
        }