forked from trent_larson/crowd-funder-for-time-pwa
catch more errors if something catastrophic happens to encrypted data
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user