diff --git a/src/main/java/com/sparrowwallet/sparrow/control/WebcamView.java b/src/main/java/com/sparrowwallet/sparrow/control/WebcamView.java index d38a0192..cb160662 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/WebcamView.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/WebcamView.java @@ -4,8 +4,12 @@ import javafx.scene.Node; import javafx.scene.control.Label; import javafx.scene.image.ImageView; import javafx.scene.layout.Region; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class WebcamView { + private static final Logger log = LoggerFactory.getLogger(WebcamView.class); + private final ImageView imageView; private final WebcamService service; private final Region view; @@ -47,7 +51,7 @@ public class WebcamView { imageView.imageProperty().unbind(); statusPlaceholder.setText("Error"); getChildren().setAll(statusPlaceholder); - service.getException().printStackTrace(); + log.error("Failed to start web cam", service.getException()); break; case SUCCEEDED: // unreachable... diff --git a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java index a365c97e..de675349 100644 --- a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java +++ b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java @@ -693,6 +693,9 @@ public class HeadersController extends TransactionFormController implements Init if(headersForm.getSigningWallet() instanceof FinalizingPSBTWallet) { //Ensure the script hashes of the UTXOs in FinalizingPSBTWallet are subscribed to ElectrumServer.TransactionHistoryService historyService = new ElectrumServer.TransactionHistoryService(headersForm.getSigningWallet()); + historyService.setOnFailed(workerStateEvent -> { + log.error("Error subscribing FinalizingPSBTWallet script hashes", workerStateEvent.getSource().getException()); + }); historyService.start(); } @@ -702,6 +705,7 @@ public class HeadersController extends TransactionFormController implements Init }); broadcastTransactionService.setOnFailed(workerStateEvent -> { broadcastProgressBar.setProgress(0); + log.error("Error broadcasting transaction", workerStateEvent.getSource().getException()); AppController.showErrorDialog("Error broadcasting transaction", workerStateEvent.getSource().getException().getMessage()); broadcastButton.setDisable(false); }); @@ -901,6 +905,9 @@ public class HeadersController extends TransactionFormController implements Init updateBlockchainForm(blockTransaction, AppController.getCurrentBlockHeight()); } }); + transactionReferenceService.setOnSucceeded(failEvent -> { + log.error("Could not update block transaction", failEvent.getSource().getException()); + }); transactionReferenceService.start(); } } diff --git a/src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java b/src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java index e7f5b561..a8a6e15f 100644 --- a/src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java +++ b/src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java @@ -340,7 +340,7 @@ public class TransactionController implements Initializable { }); }); transactionReferenceService.setOnFailed(failedEvent -> { - failedEvent.getSource().getException().printStackTrace(); + log.error("Error fetching transaction or input references", failedEvent.getSource().getException()); }); transactionReferenceService.start(); } @@ -357,7 +357,7 @@ public class TransactionController implements Initializable { }); }); transactionOutputsReferenceService.setOnFailed(failedEvent -> { - failedEvent.getSource().getException().printStackTrace(); + log.error("Error fetching transaction output references", failedEvent.getSource().getException()); }); transactionOutputsReferenceService.start(); } diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java b/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java index c57ed0d2..3408b072 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java @@ -71,7 +71,7 @@ public class WalletForm { updateWallet(previousWallet, blockHeight); }); historyService.setOnFailed(workerStateEvent -> { - workerStateEvent.getSource().getException().printStackTrace(); + log.error("Error retrieving wallet history", workerStateEvent.getSource().getException()); }); historyService.start(); }