error handling

This commit is contained in:
kolaente 2019-03-21 19:29:14 +01:00
parent 068060ace5
commit dfdd6bbd36
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -301,7 +301,17 @@ class _TaskEditPageState extends State<TaskEditPage> {
);
// update the labels
VikunjaGlobal.of(context).labelTaskBulkService.update(updatedTask, _labels);
VikunjaGlobal.of(context).labelTaskBulkService.update(updatedTask, _labels).catchError((err) {
setState(() => _loading = false);
Scaffold.of(context).showSnackBar(
SnackBar(
content: Text('Something went wrong: ' + err.toString()),
action: SnackBarAction(
label: 'CLOSE',
onPressed: Scaffold.of(context).hideCurrentSnackBar),
),
);
});
VikunjaGlobal.of(context).taskService.update(updatedTask).then((_) {
setState(() => _loading = false);