mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
- Ignore Socket Exception "bad file descriptor"
- Add nullability to anypay API response failure [skip ci]
This commit is contained in:
parent
f5fa87abfd
commit
d85805902d
2 changed files with 6 additions and 5 deletions
|
@ -80,7 +80,7 @@ class AnyPayApi {
|
|||
final response = await post(Uri.parse(uri), headers: headers, body: utf8.encode(json.encode(body)));
|
||||
if (response.statusCode == 400) {
|
||||
final decodedBody = json.decode(response.body) as Map<String, dynamic>;
|
||||
throw Exception(decodedBody['message'] as String);
|
||||
throw Exception(decodedBody['message'] as String? ?? 'Unexpected response\nError code: 400');
|
||||
}
|
||||
|
||||
if (response.statusCode != 200) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue