Files
freeCodeCamp/api-server/server/utils/react.js
Mrugesh Mohapatra d8f764fee1 revert(api): decouple api from curriculum
This reverts commit c077ffe4b9
via PR #40703
2021-02-25 02:17:28 +05:30

7 lines
142 B
JavaScript

export const errorThrowerMiddleware = () => next => action => {
if (action.error) {
throw action.payload;
}
return next(action);
};