private FaultException HandleException(Exception ex) { //we need to look at the exception inside here and determine what on earth to do with it. _exLog.Error(ex.ToString()); ZoneFoxFault fault = ZoneFoxFault.CreateFrom(ex); string reason = !string.IsNullOrWhiteSpace(fault.InnerException) ? string.Format("{0}", fault.InnerException) : string.Format("{0}", fault.Message); return(new FaultException <ZoneFoxFault>(fault, new FaultReason(reason))); }
public static ZoneFoxFault CreateFrom(Exception ex) { var fault = new ZoneFoxFault(); if (ex.StackTrace != null) { fault.StackTrace = ex.StackTrace; } if (ex.InnerException != null) { fault.InnerException = ex.InnerException.Message; } fault.Message = ex.Message; fault.AdditionalDetails = ex.ToString(); return(fault); }