Skip to content
This repository was archived by the owner on Jan 5, 2021. It is now read-only.

Commit e5af73d

Browse files
committed
Improve logs for failed requests
1 parent bef4dd2 commit e5af73d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/pages/download_ussd_page.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,21 @@ class _DownloadUssdPageState extends State<DownloadUssdPage> {
5656
UssdRoot.fromJson(parsedJson);
5757
prefs.setString('hash', actualHash);
5858
prefs.setString('config', body);
59+
} else {
60+
throw Exception(
61+
'Request failed: ${resp.request.url}\n'
62+
'StatusCode: ${resp.statusCode}\n'
63+
'Body: ${resp.body}',
64+
);
5965
}
6066
}
6167
prefs.setInt('day', actualDay);
68+
} else {
69+
throw Exception(
70+
'Request failed: ${resp.request.url}\n'
71+
'StatusCode: ${resp.statusCode}\n'
72+
'Body: ${resp.body}',
73+
);
6274
}
6375
}
6476
Navigator.pushReplacement(

0 commit comments

Comments
 (0)