Show algod error
2i2i opened this issue · 2 comments
2i2i commented
E.g. in src/repositories/transaction_repository.dart
-> sendTransaction
or sendTransactions
-> on DioError catch (ex)
:
There is a message from algod
in ex.response.data
. Would be helpful to either print this or make it part of the AlgorandException
.
RootSoft commented
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']);
}
}
2i2i commented
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.