private void CatchException <T>(Exception ex, MI4TServiceResponse <T> serviceResponse) { MI4TServiceFault fault = new MI4TServiceFault(); ExceptionHelper.HandleException(ex, out fault); serviceResponse.ResponseContext.FaultCollection.Add(fault); }
public static void HandleException(Exception exception, out MI4TServiceFault fault) { MI4TIndexingException ampException = exception as MI4TIndexingException; fault = new MI4TServiceFault(); if (ampException != null) { fault.Code = ampException.Code; fault.Message = ampException.Message; } else { fault.Code = MI4T.Common.Services.MI4TServiceConstants.ServiceFault.UNKNOWN_EXCEPTION_CODE; fault.Message = MI4T.Common.Services.MI4TServiceConstants.ServiceFault.UNKNOWN_EXCEPTION_MESSAGE; } }