1
0
mirror of https://github.com/git-touch/git-touch synced 2025-01-19 02:40:05 +01:00

fix(github): throw on error

This commit is contained in:
Rongjian Zhang 2020-01-31 15:37:17 +08:00
parent 97bb7165f7
commit fe8bf0a800

View File

@ -296,8 +296,10 @@ class AuthModel with ChangeNotifier {
final res = await http final res = await http
.get(_apiPrefix + url, headers: headers) .get(_apiPrefix + url, headers: headers)
.timeout(_timeoutDuration); .timeout(_timeoutDuration);
// Fimber.d(res.body);
final data = json.decode(res.body); final data = json.decode(res.body);
if (res.statusCode >= 400) {
throw data['message'];
}
return data; return data;
} }