From 37ea2d341f2a305265b0dc21b92cbc110fdb41eb Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Mon, 20 Feb 2023 22:25:54 +0200 Subject: [PATCH] Add Exception handler to report loading wallet issues --- lib/reactions/on_authentication_state_change.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/reactions/on_authentication_state_change.dart b/lib/reactions/on_authentication_state_change.dart index edadf33b0..7521170e6 100644 --- a/lib/reactions/on_authentication_state_change.dart +++ b/lib/reactions/on_authentication_state_change.dart @@ -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; }