18.12 Handling Errors
This commit is contained in:
parent
f1fcfac4c5
commit
e12277da94
8
src/functions/function-show-error-message.js
Normal file
8
src/functions/function-show-error-message.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { Dialog } from 'quasar'
|
||||||
|
|
||||||
|
export function showErrorMessage (errorMessage) {
|
||||||
|
Dialog.create({
|
||||||
|
title: 'Error',
|
||||||
|
message: errorMessage
|
||||||
|
})
|
||||||
|
}
|
@ -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 () {
|
||||||
|
Loading…
Reference in New Issue
Block a user