File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ export default function makeFindMixin(options) {
52
52
const FETCH_PARAMS = `${ prefix } FetchParams`
53
53
const WATCH = `${ prefix } Watch`
54
54
const QUERY_WHEN = `${ prefix } QueryWhen`
55
+ const ERROR = `${ prefix } Error`
55
56
const GET_ACTION = `get${ capitalized } `
56
57
const GET_GETTER = `get${ capitalized } FromStore`
57
58
const LOCAL = `${ prefix } Local`
@@ -60,7 +61,8 @@ export default function makeFindMixin(options) {
60
61
const data = {
61
62
[ IS_GET_PENDING ] : false ,
62
63
[ WATCH ] : watch ,
63
- [ QID ] : qid
64
+ [ QID ] : qid ,
65
+ [ ERROR ] : null
64
66
}
65
67
66
68
const mixin = {
@@ -97,9 +99,16 @@ export default function makeFindMixin(options) {
97
99
return this . $store
98
100
. dispatch ( `${ this [ SERVICE_NAME ] } /get` , [ idToUse , paramsToUse ] )
99
101
. then ( response => {
102
+ // To prevent thrashing, only clear ERROR on response, not on initial request.
103
+ this [ ERROR ] = null
104
+
100
105
this [ IS_GET_PENDING ] = false
101
106
return response
102
107
} )
108
+ . catch ( error => {
109
+ this [ ERROR ] = error
110
+ return error
111
+ } )
103
112
}
104
113
}
105
114
}
You can’t perform that action at this time.
0 commit comments