diff --git a/src/main/java/com/sparrowwallet/sparrow/net/ExchangeSource.java b/src/main/java/com/sparrowwallet/sparrow/net/ExchangeSource.java index e6d25180..8fb5e0b2 100644 --- a/src/main/java/com/sparrowwallet/sparrow/net/ExchangeSource.java +++ b/src/main/java/com/sparrowwallet/sparrow/net/ExchangeSource.java @@ -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(); } } @@ -86,8 +90,12 @@ public enum ExchangeSource { try(InputStream is = (proxy == null ? new URL(url).openStream() : new URL(url).openConnection(proxy).getInputStream()); Reader reader = new InputStreamReader(is, StandardCharsets.UTF_8)) { Gson gson = new Gson(); return gson.fromJson(reader, CoinGeckoRates.class); - } catch (Exception e) { - log.error("Error retrieving currency rates", e); + } catch(Exception e) { + if(log.isDebugEnabled()) { + log.warn("Error retrieving currency rates", e); + } else { + log.warn("Error retrieving currency rates (" + e.getMessage() + ")"); + } return new CoinGeckoRates(); } } diff --git a/src/main/java/com/sparrowwallet/sparrow/net/FeeRatesSource.java b/src/main/java/com/sparrowwallet/sparrow/net/FeeRatesSource.java index 487d8a82..2351f564 100644 --- a/src/main/java/com/sparrowwallet/sparrow/net/FeeRatesSource.java +++ b/src/main/java/com/sparrowwallet/sparrow/net/FeeRatesSource.java @@ -87,7 +87,11 @@ public enum FeeRatesSource { blockTargetFeeRates.put(Integer.MAX_VALUE, threeTierRates.minimumFee); } } catch (Exception e) { - log.warn("Error retrieving recommended fee rates from " + url, 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;