Skip to content

Commit 7efc798

Browse files
committed
feat: improve error handling on frontend
1 parent 29fa034 commit 7efc798

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

apps/frontend/src/pages/app/extensions/[id].vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
22
<client-only>
3+
<ElementsInlinecard v-if="errors">
4+
An unknown error occurred. Open your browser console for more information.
5+
</ElementsInlinecard>
36
<template v-if="data?.extension">
47
<div
58
v-if="user?.admin && data.extension.status == 'ready'"

apps/frontend/src/pages/auth/forgot.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
<h1 class="!text-4xl">Forgot password</h1>
99
</div>
1010
<div class="space-y-4 p-4">
11+
<ElementsInlinecard v-if="error">
12+
An unknown error occurred.
13+
</ElementsInlinecard>
1114
<ElementsFormInput
1215
v-model="form.email"
1316
name="email"

apps/frontend/src/pages/auth/index.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
>recover your account here</NuxtLink
1717
>.
1818
</ElementsInlinecard>
19+
<ElementsInlinecard v-else-if="errors[0]">
20+
An unknown error occurred.
21+
</ElementsInlinecard>
1922
<ElementsInlinecard v-if="reset">
2023
Your password has been reset successfully. You can now sign in with your
2124
new password.

apps/frontend/src/pages/auth/register.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
>
1313
Email address or username is already in use.
1414
</ElementsInlinecard>
15-
<ElementsInlinecard v-if="errors?.includes('failed to create user')">
15+
<ElementsInlinecard v-else-if="errors?.includes('failed to create user')">
1616
Could not create user, try again later.
1717
</ElementsInlinecard>
18+
<ElementsInlinecard v-else-if="errors">
19+
An unknown error occurred.
20+
</ElementsInlinecard>
1821
<ElementsInlinecard
1922
v-if="route.query.reason == 'oauth'"
2023
class="mb-4 w-full"

apps/frontend/src/pages/auth/verify.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ const handleVerify = async () => {
100100
method: 'POST',
101101
body: form.value,
102102
})
103-
} catch {
103+
} catch (error) {
104+
console.error(error)
104105
errors.value.incorrect = true
105106
loading.value = false
106107
} finally {
@@ -122,7 +123,8 @@ const handleResend = async () => {
122123
captcha: null,
123124
},
124125
})
125-
} catch {
126+
} catch (error) {
127+
console.error(error)
126128
errors.value.resendError = true
127129
loading.value = false
128130
} finally {

0 commit comments

Comments
 (0)