add more error handling and messaging when there are bad DB errors

This commit is contained in:
2025-05-23 12:35:16 -06:00
parent 5b6c59c232
commit 1129a13e20
4 changed files with 114 additions and 31 deletions

View File

@@ -32,6 +32,13 @@
size="128"
></font-awesome>
</div>
<div v-else-if="hitError">
<span class="text-xl">Error Creating Identity</span>
<font-awesome icon="exclamation-triangle" class="fa-fw text-red-500 ml-2"></font-awesome>
<p class="text-sm text-gray-500">
Try fully restarting the app. If that doesn't work, back up all data (identities and other data) and reinstall the app.
</p>
</div>
<div v-else>
<span class="text-xl">Created!</span>
<font-awesome
@@ -62,14 +69,24 @@ import QuickNav from "../components/QuickNav.vue";
@Component({ components: { QuickNav } })
export default class NewIdentifierView extends Vue {
loading = true;
hitError = false;
$router!: Router;
async mounted() {
await generateSaveAndActivateIdentity();
this.loading = false;
setTimeout(() => {
this.$router.push({ name: "home" });
}, 1000);
this.loading = true;
this.hitError = false;
generateSaveAndActivateIdentity()
.then(() => {
this.loading = false;
setTimeout(() => {
this.$router.push({ name: "home" });
}, 1000);
})
.catch((error) => {
this.loading = false;
this.hitError = true;
console.error('Failed to generate identity:', error);
});
}
}
</script>