Skip to content

Commit

Permalink
fix(vue2): some vuex getters error not catched
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Feb 14, 2022
1 parent babc954 commit 77f4cff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/app-backend-vue2/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ function formatStoreForInspectorState (module, getters, path): CustomInspectorSt
// Only pick the getters defined in the non-namespaced module
moduleGetters = {}
for (const key of gettersKeys) {
moduleGetters[key] = getters[key]
moduleGetters[key] = canThrow(() => getters[key])
}
} else {
moduleGetters = getters
Expand Down
3 changes: 3 additions & 0 deletions packages/shell-dev-vue2/src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ export default new Vuex.Store({
},
getters: {
doubleAnswer: state => state.answer * 2,
errorGetter: () => {
throw new Error('Error from getter')
},
},
},
},
Expand Down

0 comments on commit 77f4cff

Please sign in to comment.