use of org.knowm.xchange.exceptions.RateLimitExceededException in project XChange by knowm.
the class BitfinexErrorAdapter method adapt.
public static ExchangeException adapt(BitfinexException e) {
String message = e.getMessage();
if (StringUtils.isEmpty(message)) {
return new ExchangeException(e);
}
message = message.toLowerCase();
if (message.contains("unknown symbol") || message.contains("symbol: invalid")) {
return new CurrencyPairNotValidException(message, e);
} else if (message.contains("not enough exchange balance")) {
return new FundsExceededException(message, e);
} else if (message.contains("err_rate_limit") || message.contains("ratelimit")) {
return new RateLimitExceededException(e);
} else if (message.contains("nonce")) {
return new NonceException(e);
}
return new ExchangeException(message, e);
}
Aggregations