Skip to content

Commit

Permalink
Merge pull request #4929 from bigscoop/gate-minor-fixes
Browse files Browse the repository at this point in the history
[gateio-v4] Extend error mapping
  • Loading branch information
timmolter authored Aug 16, 2024
2 parents 26953cd + 010afd3 commit f8855e5
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit f8855e5

Please sign in to comment.