extra logging and exit properly instead of rethrowing what is isn't really a true exception but rather an expected result if not transactions are found. Thanks API designers

This commit is contained in:
julian 2023-07-01 13:49:10 -06:00
parent bd5a0c1631
commit fa1dbdbe51

View file

@ -449,6 +449,15 @@ class EthTokenWallet extends ChangeNotifier with EthTokenCache {
); );
if (response.value == null) { if (response.value == null) {
if (response.exception != null &&
response.exception!.message
.contains("response is empty but status code is 200")) {
Logging.instance.log(
"No ${tokenContract.name} transfers found for $addressString",
level: LogLevel.Info,
);
return;
}
throw response.exception ?? throw response.exception ??
Exception("Failed to fetch token transaction data"); Exception("Failed to fetch token transaction data");
} }