FredericHeem / redux-act-async

Reduce boilerplate for redux async actions and reducers
Apache License 2.0
125 stars 22 forks source link

warning with node 7.x #24

Open FredericHeem opened 7 years ago

FredericHeem commented 7 years ago
(node:80559) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): AssertionError: expected undefined to equal 'ciccio'
(node:80559) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:80559) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): [object Object]
mastilver commented 7 years ago

I think it's because noRethrow is set to false and you are not handling the error

With:

const testAction = createActionAsync('test', () => Promise.reject(new Error('an error')));

This is fine:

dispatch(testAction()).catch(err => console.error(err));

While this is not and will display error messages (And kill the process on node@8):

dispatch(testAction());