mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 01:37:40 +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);
|
||||
try {
|
||||
socket!.write(jsonrpc(method: method, id: id, params: params));
|
||||
|
||||
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