@Test public void translateDivisionMismatch() { Assert.assertTrue(translator.translate("send", null, new DivisionMismatchException("foo")) instanceof InvalidDataAccessApiUsageException); }
@Override public DataAccessException translate(String task, String rpc, RpcException e) { if (e instanceof DivisionNotFoundException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof BadCredentialsException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof ChangeVerifyCodeException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof ServiceTemporarilyDownException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof VerifyCodeExpiredException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof DivisionMismatchException) { return new InvalidDataAccessApiUsageException(getMessage(task, rpc), e); } else if (e instanceof RpcContextAccessDeniedException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof LockedException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof RpcContextNotFoundException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof RpcNotFoundException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof ProductionMismatchException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof ServerUnavailableException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof ServerNotFoundException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof ConnectionClosedException) { return new InvalidDataAccessApiUsageException(getMessage(task, rpc), e); } else if (e instanceof TimeoutWaitingForRpcResponseException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof TimeoutWaitingForIdleConnectionException) { return new TransientDataAccessResourceException(getMessage(task, rpc), e); } if (CLOSE_TASK.equals(task)) { return new CleanupFailureDataAccessException(getMessage(task, rpc), e); } return new DataRetrievalFailureException(getMessage(task, rpc), e); }
DefaultRpcExceptionTranslator implements RpcExceptionTranslator { @Override public DataAccessException translate(String task, String rpc, RpcException e) { if (e instanceof DivisionNotFoundException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof BadCredentialsException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof ChangeVerifyCodeException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof ServiceTemporarilyDownException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof VerifyCodeExpiredException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof DivisionMismatchException) { return new InvalidDataAccessApiUsageException(getMessage(task, rpc), e); } else if (e instanceof RpcContextAccessDeniedException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof LockedException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof RpcContextNotFoundException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof RpcNotFoundException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof ProductionMismatchException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof ServerUnavailableException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof ServerNotFoundException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof ConnectionClosedException) { return new InvalidDataAccessApiUsageException(getMessage(task, rpc), e); } else if (e instanceof TimeoutWaitingForRpcResponseException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof TimeoutWaitingForIdleConnectionException) { return new TransientDataAccessResourceException(getMessage(task, rpc), e); } if (CLOSE_TASK.equals(task)) { return new CleanupFailureDataAccessException(getMessage(task, rpc), e); } return new DataRetrievalFailureException(getMessage(task, rpc), e); } }
DefaultRpcExceptionTranslator implements RpcExceptionTranslator { @Override public DataAccessException translate(String task, String rpc, RpcException e) { if (e instanceof DivisionNotFoundException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof BadCredentialsException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof ChangeVerifyCodeException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof ServiceTemporarilyDownException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof VerifyCodeExpiredException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof DivisionMismatchException) { return new InvalidDataAccessApiUsageException(getMessage(task, rpc), e); } else if (e instanceof RpcContextAccessDeniedException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof LockedException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof RpcContextNotFoundException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof RpcNotFoundException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof ProductionMismatchException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof ServerUnavailableException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof ServerNotFoundException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof ConnectionClosedException) { return new InvalidDataAccessApiUsageException(getMessage(task, rpc), e); } else if (e instanceof TimeoutWaitingForRpcResponseException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof TimeoutWaitingForIdleConnectionException) { return new TransientDataAccessResourceException(getMessage(task, rpc), e); } if (CLOSE_TASK.equals(task)) { return new CleanupFailureDataAccessException(getMessage(task, rpc), e); } return new DataRetrievalFailureException(getMessage(task, rpc), e); }  }
DefaultRpcExceptionTranslator implements RpcExceptionTranslator { @Override public DataAccessException translate(String task, String rpc, RpcException e) { if (e instanceof DivisionNotFoundException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof BadCredentialsException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof ChangeVerifyCodeException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof ServiceTemporarilyDownException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof VerifyCodeExpiredException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof DivisionMismatchException) { return new InvalidDataAccessApiUsageException(getMessage(task, rpc), e); } else if (e instanceof RpcContextAccessDeniedException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof LockedException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof RpcContextNotFoundException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof RpcNotFoundException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof ProductionMismatchException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof ServerUnavailableException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof ServerNotFoundException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof ConnectionClosedException) { return new InvalidDataAccessApiUsageException(getMessage(task, rpc), e); } else if (e instanceof TimeoutWaitingForRpcResponseException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof TimeoutWaitingForIdleConnectionException) { return new TransientDataAccessResourceException(getMessage(task, rpc), e); } if (CLOSE_TASK.equals(task)) { return new CleanupFailureDataAccessException(getMessage(task, rpc), e); } return new DataRetrievalFailureException(getMessage(task, rpc), e); }  @Override DataAccessException translate(String task, String rpc, RpcException e); }
DefaultRpcExceptionTranslator implements RpcExceptionTranslator { @Override public DataAccessException translate(String task, String rpc, RpcException e) { if (e instanceof DivisionNotFoundException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof BadCredentialsException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof ChangeVerifyCodeException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof ServiceTemporarilyDownException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof VerifyCodeExpiredException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof DivisionMismatchException) { return new InvalidDataAccessApiUsageException(getMessage(task, rpc), e); } else if (e instanceof RpcContextAccessDeniedException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof LockedException) { return new PermissionDeniedDataAccessException(getMessage(task, rpc), e); } else if (e instanceof RpcContextNotFoundException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof RpcNotFoundException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof ProductionMismatchException) { return new InvalidDataAccessResourceUsageException(getMessage(task, rpc), e); } else if (e instanceof ServerUnavailableException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof ServerNotFoundException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof ConnectionClosedException) { return new InvalidDataAccessApiUsageException(getMessage(task, rpc), e); } else if (e instanceof TimeoutWaitingForRpcResponseException) { return new DataAccessResourceFailureException(getMessage(task, rpc), e); } else if (e instanceof TimeoutWaitingForIdleConnectionException) { return new TransientDataAccessResourceException(getMessage(task, rpc), e); } if (CLOSE_TASK.equals(task)) { return new CleanupFailureDataAccessException(getMessage(task, rpc), e); } return new DataRetrievalFailureException(getMessage(task, rpc), e); }  @Override DataAccessException translate(String task, String rpc, RpcException e); static final String CLOSE_TASK; }