catch electrum call errors

This commit is contained in:
Matthew Fosse 2024-10-23 13:30:28 -07:00
parent da136425c3
commit 7b276a3bc0

View file

@ -447,9 +447,14 @@ class ElectrumClient {
final id = _id;
idCallback?.call(id);
_registryTask(id, completer);
socket!.write(jsonrpc(method: method, id: id, params: params));
try {
socket!.write(jsonrpc(method: method, id: id, params: params));
return completer.future;
return completer.future;
} catch (e) {
print("call error: $e");
return null;
}
}
Future<dynamic> callWithTimeout(
@ -471,8 +476,8 @@ class ElectrumClient {
return completer.future;
} catch (e) {
print("callWithTimeout $e");
rethrow;
print("callWithTimeout: $e");
return null;
}
}