mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 13:36:50 +00:00
Cleanup
This commit is contained in:
parent
31ed4c6a7b
commit
bf7a0e72bf
@ -34,7 +34,7 @@ class APIResponse {
|
|||||||
dynamic data = {};
|
dynamic data = {};
|
||||||
|
|
||||||
// Request is "valid" if a statusCode was returned
|
// Request is "valid" if a statusCode was returned
|
||||||
bool isValid() => statusCode >= 0;
|
bool isValid() => (statusCode >= 0) && (statusCode < 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -128,10 +128,10 @@ Future<void> showServerError(String title, String description) async {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> showStatusCodeError(int status, {int expected = 200}) async {
|
Future<void> showStatusCodeError(int status) async {
|
||||||
|
|
||||||
String msg = L10().responseInvalid;
|
String msg = L10().responseInvalid;
|
||||||
String extra = "Server responded with status code ${status}";
|
String extra = "${L10().statusCode}: ${status}";
|
||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 400:
|
case 400:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user