Add Exception handler to report loading wallet issues

This commit is contained in:
OmarHatem 2023-02-20 22:25:54 +02:00
parent 7b35604ff5
commit 37ea2d341f

View file

@ -1,4 +1,5 @@
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/utils/exception_handler.dart';
import 'package:flutter/widgets.dart';
import 'package:mobx/mobx.dart';
import 'package:cake_wallet/entities/load_current_wallet.dart';
@ -16,8 +17,9 @@ void startAuthenticationStateChange(AuthenticationStore authenticationStore,
if (state == AuthenticationState.installed) {
try {
await loadCurrentWallet();
} catch (e) {
loginError = e;
} catch (error, stack) {
loginError = error;
ExceptionHandler.onError(FlutterErrorDetails(exception: error, stack: stack));
}
return;
}