methods:{
async getPosts(time = 0) {
let got = await fetch('/getPosts', { method: 'POST', body: JSON.stringify({ section: '*', modifiedAfter: time }) })
.then(r => r.json())
.catch(fetchError)
if (got.success) {
this.posts.push(...got.docs)
if (got.docs.length < got.limit) this.reachedEnd = true
this.sections = got.sections
// return
}
throw createError({ fatal: true })
}
}
#Doesn't show error page if called from inside an async function.
12 messages · Page 1 of 1 (latest)
Where are you calling that function?
If you want to show an error page at that point you can use showError.
Thanks. showError worked. But why createError doesn't work?
It's being called in mounted, so it's not being caught and handled anywhere