Skip to content

Commit 488197b

Browse files
committed
Extra logs and warnings in case of some unexpected error states
1 parent 4f84581 commit 488197b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/cubit/vault_cubit.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,10 @@ class VaultCubit extends Cubit<VaultState> {
251251
// This can happen if the remote file has new credentials. We'll have to try again with different user supplied passwords for the local and remote files.
252252
emit(VaultRemoteFileCredentialsRequired(localFile, false));
253253
return;
254-
} on Exception {
255-
emitError("Kee Vault startup failed. Couldn't apply a pending change to your local vault.",
254+
} on Exception catch (e, stack) {
255+
l.e("Kee Vault startup failed. Couldn't apply a pending change to your local vault: $e \n\n stack: $stack");
256+
emitError(
257+
"Kee Vault startup failed. Sorry, we couldn't apply a pending change to your local vault for some unexpected reason. Please navigate to the Help menu item and then Share your application logs with us so that we can discuss and advise what to do next. If you have your Kee Vault on other devices, we recommend disconnecting them from the internet and exporting your vault to a KDBX file now, especially if you do not have a recent backup. We are likely to be able to restore all or most of your data but this may take a significant amount of time so the sooner you contact us to explain the details of what may have triggered the problem and share the error logs with us, the sooner we'll get you back up and running.",
256258
forceNotLoaded: true);
257259
return;
258260
}
@@ -671,9 +673,10 @@ class VaultCubit extends Cubit<VaultState> {
671673
// etag during the next refresh or upload operation, we will re-download the update
672674
// and perform a merge. This should be a NOOP but is inefficient.
673675
handleRefreshAuthError(s.vault);
674-
} on Exception {
676+
} on Exception catch (e, stack) {
677+
l.e("Kee Vault failed to apply a change to your local vault for some unexpected reason or hardware fault. Please Share these application logs with us so that we can discuss and advise what to do next. If you have your Kee Vault on other devices, we recommend disconnecting them from the internet and exporting your vault to a KDBX file now, especially if you do not have a recent backup. We are likely to be able to restore all or most of your data but this may take a significant amount of time so the sooner you contact us to explain the details of what may have triggered the problem and share the error logs with us, the sooner we'll get you back up and running. Background refresh error: $e \n\n stack: $stack");
675678
emitError(
676-
'Background refresh error. Check your device has enough storage space. Otherwise, this may indicate a faulty operating system or hardware.',
679+
'Background refresh error. Check your device has enough storage space. Otherwise, this may indicate a faulty operating system or hardware. Export your Vault now just in case. Then inspect extra error information in the Menu > Help > Logs.',
677680
toast: true);
678681
return;
679682
}

0 commit comments

Comments
 (0)