From 0f665bd6021f65f891648a8fe71f8e9017784682 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Mon, 5 Feb 2024 16:17:33 -0600 Subject: [PATCH] remove unnecessary try-catch --- .../subscribable_electrumx_client.dart | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/lib/electrumx_rpc/subscribable_electrumx_client.dart b/lib/electrumx_rpc/subscribable_electrumx_client.dart index 34136a51e..1f21dd906 100644 --- a/lib/electrumx_rpc/subscribable_electrumx_client.dart +++ b/lib/electrumx_rpc/subscribable_electrumx_client.dart @@ -114,29 +114,25 @@ class SubscribableElectrumXClient { ); // Listen to global event bus for Tor preference changes. - try { - _torPreferenceListener = bus.on().listen( - (event) async { - // Close open socket (if open). - final tempSocket = _socket; - _socket = null; - await tempSocket?.close(); + _torPreferenceListener = bus.on().listen( + (event) async { + // Close open socket (if open). + final tempSocket = _socket; + _socket = null; + await tempSocket?.close(); - // Close open SOCKS socket (if open). - final tempSOCKSSocket = _socksSocket; - _socksSocket = null; - await tempSOCKSSocket?.close(); + // Close open SOCKS socket (if open). + final tempSOCKSSocket = _socksSocket; + _socksSocket = null; + await tempSOCKSSocket?.close(); - // Clear subscriptions. - _tasks.clear(); + // Clear subscriptions. + _tasks.clear(); - // Cancel alive timer - _aliveTimer?.cancel(); - }, - ); - } catch (e, s) { - print(s); - } + // Cancel alive timer + _aliveTimer?.cancel(); + }, + ); } factory SubscribableElectrumXClient.from({