protected ExchangeException handleException(DVChainException exception) { if (exception.getMessage().contains("Internal server error")) { return new InternalServerException(exception); } else if (exception.getMessage().contains("An unknown error")) { return new InternalServerException(exception); } else { return new ExchangeException(exception); } } }
protected ExchangeException handleError(Exception exception) { if (exception != null && exception.getMessage() != null) { if (exception.getMessage().contains("Insufficient")) { return new FundsExceededException(exception); } else if (exception.getMessage().contains("Rate limit exceeded")) { return new RateLimitExceededException(exception); } else if (exception.getMessage().contains("Internal server error")) { return new InternalServerException(exception); } else if (exception.getMessage().contains("The system is currently overloaded")) { return new SystemOverloadException(exception); } else { return new ExchangeException(exception.getMessage(), exception); } } return new ExchangeException(exception); }
protected ExchangeException handleError(BitflyerException exception) { if (exception.getMessage().contains("Insufficient")) { return new FundsExceededException(exception); } else if (exception.getMessage().contains("Rate limit exceeded")) { return new RateLimitExceededException(exception); } else if (exception.getMessage().contains("Internal server error")) { return new InternalServerException(exception); } else { return new ExchangeException(exception); } } }
protected ExchangeException handleError(CoinbaseProException exception) { if (exception.getMessage().contains("Insufficient")) { return new FundsExceededException(exception); } else if (exception.getMessage().contains("Rate limit exceeded")) { return new RateLimitExceededException(exception); } else if (exception.getMessage().contains("Internal server error")) { return new InternalServerException(exception); } else { return new ExchangeException(exception); } } }
protected ExchangeException handleError(CryptonitException exception) { if (exception.getMessage().contains("You can only buy")) { return new FundsExceededException(exception); } else if (exception.getMessage().contains("Invalid limit exceeded")) { return new RateLimitExceededException(exception); } else if (exception.getMessage().contains("Invalid nonce")) { return new NonceException(exception.getMessage()); } else if (exception.getMessage().contains("Internal server error")) { return new InternalServerException(exception); } else { return new ExchangeException(exception); } } }
protected ExchangeException handleError(BitstampException exception) { if (exception.getMessage().contains("You can only buy")) { return new FundsExceededException(exception); } else if (exception.getMessage().contains("Invalid limit exceeded")) { return new RateLimitExceededException(exception); } else if (exception.getMessage().contains("Invalid nonce")) { return new NonceException(exception.getMessage()); } else if (exception.getMessage().contains("Internal server error")) { return new InternalServerException(exception); } else { return new ExchangeException(exception); } } }
public static ExchangeException adapt(BithumbException e) { final String message = e.getMessage(); switch (e.getStatus()) { case "5100": case "5200": // Not Member case "5300": // Invalid Apikey case "5302": return new ExchangeSecurityException(message); case "5500": // Invalid Parameter return new ExchangeException(message); case "5400": // Database Fail return new InternalServerException(message); case "5600": // 상황 별 에러 메시지 출력 default: return new ExchangeException(message); } } }
protected ExchangeException handleError(Exception exception) { if (exception != null && exception.getMessage() != null) { if (exception.getMessage().contains("Insufficient")) { return new FundsExceededException(exception); } else if (exception.getMessage().contains("Rate limit exceeded")) { return new RateLimitExceededException(exception); } else if (exception.getMessage().contains("Internal server error")) { return new InternalServerException(exception); } else if (exception.getMessage().contains("The system is currently overloaded")) { return new SystemOverloadException(exception); } else { return new ExchangeException(exception.getMessage(), exception); } } return new ExchangeException(exception); }
protected ExchangeException handleError(GDAXException exception) { if (exception.getMessage().contains("Insufficient")) { return new FundsExceededException(exception); } else if (exception.getMessage().contains("Rate limit exceeded")) { return new RateLimitExceededException(exception); } else if (exception.getMessage().contains("Internal server error")) { return new InternalServerException(exception); } else { return new ExchangeException(exception); } } }
protected ExchangeException handleError(BitflyerException exception) { if (exception.getMessage().contains("Insufficient")) { return new FundsExceededException(exception); } else if (exception.getMessage().contains("Rate limit exceeded")) { return new RateLimitExceededException(exception); } else if (exception.getMessage().contains("Internal server error")) { return new InternalServerException(exception); } else { return new ExchangeException(exception); } } }
protected ExchangeException handleError(BitstampException exception) { if (exception.getMessage().contains("You can only buy")) { return new FundsExceededException(exception); } else if (exception.getMessage().contains("Invalid limit exceeded")) { return new RateLimitExceededException(exception); } else if (exception.getMessage().contains("Invalid nonce")) { return new NonceException(exception.getMessage()); } else if (exception.getMessage().contains("Internal server error")) { return new InternalServerException(exception); } else { return new ExchangeException(exception); } } }