Skip to content

Commit

Permalink
what was i writing
Browse files Browse the repository at this point in the history
  • Loading branch information
qin-guan committed Jul 21, 2023
1 parent ab6983a commit ef00ca6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pages/____________login.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import InputText from 'primevue/inputtext'
import Button from 'primevue/button'
import type { TRPCError } from '@trpc/server'
import { TRPCClientError } from '@trpc/client'
const config = useRuntimeConfig()
const { $client } = useNuxtApp()
Expand Down Expand Up @@ -36,7 +36,10 @@ async function generateOtp() {
}
catch (err) {
console.error(err)
formData.error = (err as TRPCError).message
if (err instanceof TRPCClientError)
formData.error = err.message
else
formData.error = JSON.stringify(err)
}
finally {
formData.pending = false
Expand All @@ -54,7 +57,10 @@ async function verifyOtp() {
}
catch (err) {
console.error(err)
formData.error = (err as TRPCError).message
if (err instanceof TRPCClientError)
formData.error = err.message
else
formData.error = JSON.stringify(err)
}
finally {
formData.pending = false
Expand Down

0 comments on commit ef00ca6

Please sign in to comment.