From 010afd39b7b5928b65ae34a999e9aa25af16711e Mon Sep 17 00:00:00 2001 From: Dmitri Karpovich Date: Thu, 1 Aug 2024 21:49:32 +0200 Subject: [PATCH] [gateio-v4] Extend error mapping --- .../org/knowm/xchange/gateio/GateioErrorAdapter.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xchange-gateio-v4/src/main/java/org/knowm/xchange/gateio/GateioErrorAdapter.java b/xchange-gateio-v4/src/main/java/org/knowm/xchange/gateio/GateioErrorAdapter.java index 11324b523f1..9778ce96da1 100644 --- a/xchange-gateio-v4/src/main/java/org/knowm/xchange/gateio/GateioErrorAdapter.java +++ b/xchange-gateio-v4/src/main/java/org/knowm/xchange/gateio/GateioErrorAdapter.java @@ -1,7 +1,14 @@ package org.knowm.xchange.gateio; import lombok.experimental.UtilityClass; -import org.knowm.xchange.exceptions.*; +import org.knowm.xchange.exceptions.ExchangeException; +import org.knowm.xchange.exceptions.ExchangeSecurityException; +import org.knowm.xchange.exceptions.FundsExceededException; +import org.knowm.xchange.exceptions.InstrumentNotValidException; +import org.knowm.xchange.exceptions.InternalServerException; +import org.knowm.xchange.exceptions.OrderAmountUnderMinimumException; +import org.knowm.xchange.exceptions.OrderNotValidException; +import org.knowm.xchange.exceptions.RateLimitExceededException; import org.knowm.xchange.gateio.dto.GateioException; @UtilityClass @@ -42,7 +49,7 @@ public ExchangeException adapt(GateioException e) { return new InternalServerException(e.getMessage(), e); case INVALID_PARAM_VALUE: - if (e.getMessage().contains("below minimum")) { + if (e.getMessage().contains("below minimum") || e.getMessage().contains("too small")) { return new OrderAmountUnderMinimumException(e.getMessage(), e); } else {