reduce error logging when fee and exchanges rate sources are unavailable

This commit is contained in:
Craig Raw 2021-04-08 08:34:31 +02:00
parent dcc63046bd
commit 57eb3a77e7
2 changed files with 16 additions and 4 deletions

View file

@ -56,7 +56,11 @@ public enum ExchangeSource {
Gson gson = new Gson();
return gson.fromJson(reader, CoinbaseRates.class);
} catch (Exception e) {
log.error("Error retrieving currency rates", e);
if(log.isDebugEnabled()) {
log.warn("Error retrieving currency rates", e);
} else {
log.warn("Error retrieving currency rates (" + e.getMessage() + ")");
}
return new CoinbaseRates();
}
}
@ -87,7 +91,11 @@ public enum ExchangeSource {
Gson gson = new Gson();
return gson.fromJson(reader, CoinGeckoRates.class);
} catch(Exception e) {
log.error("Error retrieving currency rates", e);
if(log.isDebugEnabled()) {
log.warn("Error retrieving currency rates", e);
} else {
log.warn("Error retrieving currency rates (" + e.getMessage() + ")");
}
return new CoinGeckoRates();
}
}

View file

@ -87,7 +87,11 @@ public enum FeeRatesSource {
blockTargetFeeRates.put(Integer.MAX_VALUE, threeTierRates.minimumFee);
}
} catch (Exception e) {
if(log.isDebugEnabled()) {
log.warn("Error retrieving recommended fee rates from " + url, e);
} else {
log.warn("Error retrieving recommended fee rates from " + url + " (" + e.getMessage() + ")");
}
}
return blockTargetFeeRates;