enhance exception handling in cakePay getVendors (#1833)

This commit is contained in:
Serhii 2024-11-27 17:42:00 +02:00 committed by GitHub
parent 87178b2a54
commit c3978bfbe1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -233,7 +233,8 @@ class CakePayApi {
var response = await http.get(uri, headers: headers);
if (response.statusCode != 200) {
throw Exception(response.body);
throw Exception(
'Failed to fetch vendors: statusCode - ${response.statusCode}, queryParams -$queryParams, response - ${response.body}');
}
final bodyJson = json.decode(response.body);

View file

@ -94,6 +94,10 @@ class CakePayCardsPage extends BasePage {
_cardsListViewModel.resetLoadingNextPageState();
_cardsListViewModel.getVendors();
}
_cardsListViewModel.settingsStore.selectedCakePayCountry =
_cardsListViewModel.selectedCountry;
}
});
});