Implemented error reporting solution

This commit is contained in:
Anton Stubenbord
2022-11-14 00:08:07 +01:00
parent b5aac36b2b
commit 511f8ca3f4
33 changed files with 475 additions and 110 deletions

View File

@@ -212,12 +212,12 @@ class _DocumentUploadPageState extends State<DocumentUploadPage> {
showSnackBar(context, S.of(context).documentUploadSuccessText);
Navigator.pop(context);
widget.afterUpload?.call();
} on ErrorMessage catch (error) {
showError(context, error);
} on ErrorMessage catch (error, stackTrace) {
showError(context, error, stackTrace);
} on PaperlessValidationErrors catch (errorMessages) {
setState(() => _errors = errorMessages);
} catch (other) {
showSnackBar(context, other.toString());
} catch (unknownError, stackTrace) {
showError(context, ErrorMessage.unknown(), stackTrace);
} finally {
setState(() {
_isUploadLoading = false;
@@ -233,8 +233,8 @@ class _DocumentUploadPageState extends State<DocumentUploadPage> {
onPressed: () async {
try {
getIt<DocumentsCubit>().reloadDocuments();
} on ErrorMessage catch (error) {
showError(context, error);
} on ErrorMessage catch (error, stackTrace) {
showError(context, error, stackTrace);
}
},
label: