class BittrexErrorAdapter {

  public static ExchangeException adapt(BittrexException e) {<FILL_FUNCTION_BODY>}
}

    String code = e.getCode();
    if (StringUtils.isEmpty(code)) {
      return new ExchangeException("Operation failed without any error code", e);
    }
    switch (code) {
      case "MARKET_DOES_NOT_EXIST":
        return new CurrencyPairNotValidException(e);
      default:
        String message = e.getDetails();
        if (StringUtils.isEmpty(message)) {
          message = "Operation failed with error code: " + code;
        }
        return new ExchangeException(message, e);
    }
  
<no_super_class>