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:
parent
97bb7165f7
commit
fe8bf0a800
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user