diff --git a/lib/models/auth.dart b/lib/models/auth.dart index b7a64f2..e93b7bb 100644 --- a/lib/models/auth.dart +++ b/lib/models/auth.dart @@ -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; }