From 29341fc0b03797b76715207d241b465c4d4e5996 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 9 Aug 2023 12:19:17 -0500 Subject: [PATCH] exception casting --- lib/electrumx_rpc/electrumx.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/electrumx_rpc/electrumx.dart b/lib/electrumx_rpc/electrumx.dart index 99967d2df..7d3dd3d2b 100644 --- a/lib/electrumx_rpc/electrumx.dart +++ b/lib/electrumx_rpc/electrumx.dart @@ -213,7 +213,8 @@ class ElectrumX { ); if (response.exception != null) { - throw response.exception!; + throw response.exception! + as Object; // TODO properly check that .exception is an Object } if (response.data is Map && response.data["error"] != null) { @@ -353,7 +354,8 @@ class ElectrumX { (await _rpcClient!.request(request, requestTimeout)); if (jsonRpcResponse.exception != null) { - throw jsonRpcResponse.exception!; + throw jsonRpcResponse.exception! + as Object; // TODO properly check that .exception is an Object } final response = jsonRpcResponse.data as List;