No mobile_app error handling

This commit is contained in:
estevez-dev
2019-09-03 23:35:33 +03:00
parent 8efeb3da8a
commit 0d2f1cf9aa
2 changed files with 15 additions and 5 deletions

View File

@ -301,8 +301,8 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver, Ticker
_subscribe().then((_) {
ConnectionManager().init(loadSettings: true, forceReconnect: true).then((__){
_fetchData();
}, onError: (code) {
_setErrorState(code);
}, onError: (error) {
_setErrorState(error);
});
});
}
@ -315,8 +315,8 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver, Ticker
_showInfoBottomBar(progress: true,);
ConnectionManager().init(loadSettings: false, forceReconnect: false).then((_){
_fetchData();
}, onError: (code) {
_setErrorState(code);
}, onError: (error) {
_setErrorState(error);
});
}
@ -460,10 +460,12 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver, Ticker
_setErrorState(error) {
if (error is UserError) {
setState(() {
_showBottomBar = false;
_userError = error;
});
} else {
setState(() {
_showBottomBar = false;
_userError = UserError(code: ErrorCode.UNKNOWN);
});
}