From 03abc59ed3f3d0d4616b569fe13c0ffc847974d0 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 5 Aug 2020 12:36:50 +0200 Subject: [PATCH] fix ssl handshake issue --- build.gradle | 1 + .../java/com/sparrowwallet/sparrow/io/ExchangeSource.java | 6 ++++++ .../sparrow/preferences/GeneralPreferencesController.java | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/build.gradle b/build.gradle index 45fd6772..36a8ea92 100644 --- a/build.gradle +++ b/build.gradle @@ -92,6 +92,7 @@ jlink { requires 'java.logging' requires 'javafx.base' requires 'com.fasterxml.jackson.databind' + requires 'jdk.crypto.cryptoki' } options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages', '--ignore-signing-information', '--exclude-files', '**.png'] diff --git a/src/main/java/com/sparrowwallet/sparrow/io/ExchangeSource.java b/src/main/java/com/sparrowwallet/sparrow/io/ExchangeSource.java index 6d20c11e..07c17ad4 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/ExchangeSource.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/ExchangeSource.java @@ -5,6 +5,8 @@ import com.sparrowwallet.sparrow.event.ExchangeRatesUpdatedEvent; import javafx.concurrent.ScheduledService; import javafx.concurrent.Service; import javafx.concurrent.Task; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.InputStream; import java.io.InputStreamReader; @@ -51,6 +53,7 @@ public enum ExchangeSource { Gson gson = new Gson(); return gson.fromJson(reader, CoinbaseRates.class); } catch (Exception e) { + log.error("Error retrieving currency rates", e); return new CoinbaseRates(); } } @@ -80,11 +83,14 @@ public enum ExchangeSource { Gson gson = new Gson(); return gson.fromJson(reader, CoinGeckoRates.class); } catch (Exception e) { + log.error("Error retrieving currency rates", e); return new CoinGeckoRates(); } } }; + private static final Logger log = LoggerFactory.getLogger(ExchangeSource.class); + private final String name; ExchangeSource(String name) { diff --git a/src/main/java/com/sparrowwallet/sparrow/preferences/GeneralPreferencesController.java b/src/main/java/com/sparrowwallet/sparrow/preferences/GeneralPreferencesController.java index 124ac4e5..bbc9449d 100644 --- a/src/main/java/com/sparrowwallet/sparrow/preferences/GeneralPreferencesController.java +++ b/src/main/java/com/sparrowwallet/sparrow/preferences/GeneralPreferencesController.java @@ -11,11 +11,15 @@ import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.fxml.FXML; import javafx.scene.control.ComboBox; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.Currency; import java.util.List; public class GeneralPreferencesController extends PreferencesDetailController { + private static final Logger log = LoggerFactory.getLogger(GeneralPreferencesController.class); + @FXML private ComboBox bitcoinUnit; @@ -81,6 +85,9 @@ public class GeneralPreferencesController extends PreferencesDetailController { currenciesService.setOnSucceeded(event -> { updateCurrencies(currenciesService.getValue()); }); + currenciesService.setOnFailed(event -> { + log.error("Error retrieving currencies", event.getSource().getException()); + }); currenciesService.start(); }