Closed 2i2i closed 2 years ago
You can always get the underlying exception using the included cause
object of AlgorandException
.
I might add a new property to include the api error message as well.
try {
...
} on AlgorandException catch (ex) {
final cause = ex.cause;
if (cause is DioError) {
print(cause.response?.data['message']);
}
}
You are right. I just could not figure out how to cast the Object? cause
to a DioError
(i am new to dart).
I will close the issue.
E.g. in
src/repositories/transaction_repository.dart
->sendTransaction
orsendTransactions
->on DioError catch (ex)
:There is a message from
algod
inex.response.data
. Would be helpful to either print this or make it part of theAlgorandException
.