package org.knowm.xchange.binance;

import org.apache.commons.lang3.StringUtils;
import org.knowm.xchange.binance.dto.BinanceException;
import org.knowm.xchange.exceptions.CurrencyPairNotValidException;
import org.knowm.xchange.exceptions.ExchangeException;

/** @author walec51 */
public final class BinanceErrorAdapter {

  private BinanceErrorAdapter() {}

  public static ExchangeException adapt(BinanceException e) {
    String message = e.getMessage();
    if (StringUtils.isEmpty(message)) {
      message = "Operation failed without any error message";
    }
    switch (e.getCode()) {
      case -1121:
        return new CurrencyPairNotValidException(message, e);
    }
    return new ExchangeException(message, e);
  }
}

@@ -250,16 +250,261 @@
 ception;
+%0Aimport org.knowm.xchange.exceptions.ExchangeSecurityException;%0Aimport org.knowm.xchange.exceptions.ExchangeUnavailableException;%0Aimport org.knowm.xchange.exceptions.NonceException;%0Aimport org.knowm.xchange.exceptions.RateLimitExceededException;
 %0A%0A/** @a
@@ -849,52 +849,425 @@
 e -1
-121:%0A        return new CurrencyPairNotValid
+002:%0A        return new ExchangeSecurityException(message, e);%0A      case -1003:%0A        return new RateLimitExceededException(message, e);%0A      case -1016:%0A        return new ExchangeUnavailableException(message, e);%0A      case -1021:%0A        return new NonceException(message, e);%0A      case -1121:%0A        return new CurrencyPairNotValidException(message, e);%0A      case -1122:%0A        return new ExchangeSecurity
 Exce

Classify some more Binance exceptions