Skip to content

Commit

Permalink
Added Cloudflare response status codes to BTCe adapter transport laye…
Browse files Browse the repository at this point in the history
…r temp network failure catch blocks. Bumped up version for beta 4 release.
  • Loading branch information
gazbert committed Nov 20, 2015
1 parent b22fa66 commit 32dec13
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bxbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ javamail=javax.mail-1.5.4.jar
gson=gson-2.3.1.jar

# The BX-bot core jar (mandatory)
bxbot_core=bxbot-core-0.1-beta.3-SNAPSHOT.jar
bxbot_core=bxbot-core-0.1-beta.4.jar

# Your Trading Strategies (optional)
# Needed if you're not using the sample included with the bot OR you have not included your strats in the bxbot_core jar.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>com.gazbert.bxbot</groupId>
<artifactId>bxbot-core</artifactId>
<packaging>jar</packaging>
<version>0.1-beta.3-SNAPSHOT</version>
<version>0.1-beta.4</version>
<name>BX-bot</name>
<description>BX-bot is a simple Java algorithmic trading bot for trading Bitcoin on cryptocurrency exchanges.</description>
<url>http://github.com/gazbert/BX-bot</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,12 @@ private String sendPublicRequestToExchange(String apiMethod, String resource) th
*/
if (exchangeConnection != null && (exchangeConnection.getResponseCode() == 502
|| exchangeConnection.getResponseCode() == 503
|| exchangeConnection.getResponseCode() == 504)) {
|| exchangeConnection.getResponseCode() == 504

// Cloudflare related
|| exchangeConnection.getResponseCode() == 520
|| exchangeConnection.getResponseCode() == 522
|| exchangeConnection.getResponseCode() == 525)) {

final String errorMsg = IO_50X_TIMEOUT_ERROR_MSG;
LOG.error(errorMsg, e);
Expand Down Expand Up @@ -1146,7 +1151,13 @@ private String sendAuthenticatedRequestToExchange(String apiMethod, Map<String,
*/
if (exchangeConnection != null && (exchangeConnection.getResponseCode() == 502
|| exchangeConnection.getResponseCode() == 503
|| exchangeConnection.getResponseCode() == 504)) {
|| exchangeConnection.getResponseCode() == 504

// Cloudflare related
|| exchangeConnection.getResponseCode() == 520
|| exchangeConnection.getResponseCode() == 522
|| exchangeConnection.getResponseCode() == 525)) {

final String errorMsg = IO_50X_TIMEOUT_ERROR_MSG;
LOG.error(errorMsg, e);
throw new ExchangeTimeoutException(errorMsg, e);
Expand Down

0 comments on commit 32dec13

Please sign in to comment.