fix(github): throw on error

This commit is contained in:
Rongjian Zhang 2020-01-31 15:37:17 +08:00
parent 97bb7165f7
commit fe8bf0a800
1 changed files with 3 additions and 1 deletions

View File

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