public Exception Process(Exception exception) { var adoException = exception as GenericADOException; if ((adoException != null) && DataWasTruncated(adoException)) { exception = new ApplicationErrorException(ServiceError.DataSizeWasExceeded) { {"EntityType", adoException.GetEntityType()} }; } return exception; }
public Exception Process(Exception exception) { var adoException = exception as GenericADOException; if ((adoException != null) && AppliesToThisPolicy(adoException)) { exception = new ApplicationErrorException(ServiceError.RecordIsUsedByAnotherRecord) { {"EntityType", adoException.GetEntityType()} }; } return exception; }
public Exception Process(Exception exception) { var adoException = exception as GenericADOException; if ((adoException != null) && IsUniqueConstraintViolation(adoException)) { exception = new ApplicationErrorException(ServiceError.NameCodeOrNumberIsNotUnique) { {"EntityType", adoException.GetEntityType()} }; } return exception; }
private FaultException CreateFaultForInternalError(Exception exception) { Interlocked.Increment(ref internalErrorCount); //// Compile a reference based on the current process' ID and a counter. The character 'S' represents //// an exception in one of the services. string errorReference = "S" + Process.GetCurrentProcess().Id + "-" + internalErrorCount; //logger.Error(exception, errorReference); var errorException = new ApplicationErrorException(Error.Internal) { {"AdministrativeReference", errorReference} }; return new FaultException<ApplicationErrorFault>(new ApplicationErrorFault(errorException)); }
public ApplicationErrorFault(ApplicationErrorException exception) { ErrorCode = exception.Error.Code; Parameters = exception.Parameters; }