18.12 Handling Errors

This commit is contained in:
Fredrick W. Warren 2021-02-14 21:44:39 -08:00
parent f1fcfac4c5
commit e12277da94
2 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,8 @@
import { Dialog } from 'quasar'
export function showErrorMessage (errorMessage) {
Dialog.create({
title: 'Error',
message: errorMessage
})
}

View File

@ -1,5 +1,6 @@
import { LocalStorage } from 'quasar' import { LocalStorage } from 'quasar'
import { firebaseAuth } from 'boot/firebase' import { firebaseAuth } from 'boot/firebase'
import { showErrorMessage } from 'src/functions/function-show-error-message'
const state = { const state = {
loggedIn: false loggedIn: false
@ -19,7 +20,7 @@ const actions = {
console.log('response: ', response) console.log('response: ', response)
}) })
.catch(error => { .catch(error => {
console.log('error.message: ', error) showErrorMessage(error.message)
}) })
}, },
loginUser ({ commit }, payload) { loginUser ({ commit }, payload) {
@ -28,7 +29,7 @@ const actions = {
console.log('response: ', response) console.log('response: ', response)
}) })
.catch(error => { .catch(error => {
console.log('error.message: ', error) showErrorMessage(error.message)
}) })
}, },
logoutUser () { logoutUser () {