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

7 lines
142 B
JavaScript

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