diff --git a/src/FeathersVuexGet.ts b/src/FeathersVuexGet.ts index e41339c7..d9d5f883 100644 --- a/src/FeathersVuexGet.ts +++ b/src/FeathersVuexGet.ts @@ -87,8 +87,8 @@ export default { } }, data: () => ({ - isFindPending: false, - isGetPending: false + isGetPending: false, + error: null }), computed: { item() { @@ -109,8 +109,8 @@ export default { } }, scope() { - const { item, isGetPending } = this - const defaultScope = { item, isGetPending } + const { item, isGetPending, error } = this + const defaultScope = { item, isGetPending, error } return this.editScope(defaultScope) || defaultScope } @@ -145,9 +145,14 @@ export default { getArgs.length === 1 ? this.id : getArgs ) .then(response => { - this.isGetPending = false return response }) + .catch(error => { + this.error = error + }) + .finally(() => { + this.isGetPending = false + }) } } },