catch more errors if something catastrophic happens to encrypted data

This commit is contained in:
2024-12-10 20:02:49 -07:00
parent 870d279526
commit af197f7c11
16 changed files with 238 additions and 70 deletions

View File

@@ -18,6 +18,7 @@ const enterOrStart = async (
from: RouteLocationNormalized,
next: NavigationGuardNext,
) => {
// one of the few times we use accountsDBPromise directly; try to avoid more usage
const accountsDB = await accountsDBPromise;
const num_accounts = await accountsDB.accounts.count();
if (num_accounts > 0) {
@@ -263,6 +264,9 @@ const errorHandler = (
) => {
// Handle the error here
console.error("Caught in top level error handler:", error, to, from);
alert(
"Something is very wrong. We'd love if you contacted us and let us know how you got here. Thank you!",
);
// You can also perform additional actions, such as displaying an error message or redirecting the user to a specific page
};