Skip to content

Commit 0483701

Browse files
Add error handling for createAction (#629)
- Ensure loading state is ended on error - Re-throw the caught error for further handling
1 parent cf37ed5 commit 0483701

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/module/actions/createAction.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ export function createAction (api, moduleName) {
8888

8989
return response
9090
}).catch(e => {
91-
// FIXME: This is not the way to handle errors.
92-
console.log(e)
91+
console.error('Error in createAction:', e)
92+
vuexFns.commit('endLoading')
93+
throw e
9394
})
9495
}
9596
})

0 commit comments

Comments
 (0)