mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-16 17:27:37 +00:00
catch electrum call errors
This commit is contained in:
parent
da136425c3
commit
7b276a3bc0
1 changed files with 9 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue