2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-16 20:25:26 +00:00

Show snack when encountering a server error

This commit is contained in:
Oliver
2021-08-05 08:54:02 +10:00
parent ca35f44dc8
commit acecec113e
4 changed files with 25 additions and 1 deletions

View File

@ -3,10 +3,13 @@ import 'dart:async';
import 'package:inventree/api.dart';
import 'package:flutter/cupertino.dart';
import 'package:inventree/inventree/sentry.dart';
import 'package:inventree/widget/dialogs.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:path/path.dart' as path;
import '../l10.dart';
// Paginated response object
class InvenTreePageResponse {
@ -162,6 +165,11 @@ class InvenTreeModel {
}
);
showServerError(
L10().serverError,
L10().errorFetch,
);
return false;
}
@ -226,6 +234,11 @@ class InvenTreeModel {
}
);
showServerError(
L10().serverError,
L10().errorFetch,
);
return null;
}
@ -260,6 +273,12 @@ class InvenTreeModel {
}
);
showServerError(
L10().serverError,
L10().errorCreate,
);
return null;
}