You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 21, 2020. It is now read-only.
now in the theme you can react on each error type:
<template>
<div>
<div v-if="errors.register">There was a problem with registering: {{ errors.register }}</div>
<div v-if="errors.login">There was a problem with login: {{errors.login }}</div>
</div>
</template>
setup() {
const { errors, ... } = useUser()
// ...
return { errors };
}
The text was updated successfully, but these errors were encountered:
I believe const errors = ref({}); should be already defined with properties which it contains
connsterrors=ref({register: null,login: null});
so basically UseUser interface needs to have a definition for errors and loadings objects.
also please edit examples to always clear errors for responsible methods:
constregister=()=>{errors.register=null// ----> this needs to be addedtry{// .. }catch(e){errors.register=e;}};
We need to use this way of handling errors to handle unhandled promises in our factories. e.g. at the end of useLocale and useUser. Otherwise, we will end up with unhandled rejections which are very hard to track.
errors
object that contains all of errors under the keys that are defined in the core.errors
field in the theme and is able to react on particular error itself.example of composable function:
now in the theme you can react on each error type:
The text was updated successfully, but these errors were encountered: