mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-18 06:24:20 +01:00
Show helpful toast if someone hits a 404
This commit is contained in:
@@ -50,7 +50,9 @@ class RestApiUtility {
|
||||
if (response.statusCode == 200 || response.statusCode == 201) {
|
||||
return json.decode(response.body);
|
||||
} else {
|
||||
throw Exception('Failed to post data');
|
||||
// TODO: We are bubbling up the full response to show better errors on the UI.
|
||||
// Let's put some thought into how we would like to structure this.
|
||||
throw response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,8 +68,6 @@ class RestApiUtility {
|
||||
if (response.statusCode == 200 || response.statusCode == 201) {
|
||||
return json.decode(response.body);
|
||||
} else {
|
||||
print(response.statusCode);
|
||||
print(response.body);
|
||||
throw Exception('Failed to update data with PUT request');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user