Closed steven-haddix closed 7 years ago
I would keep it out of sagas.
Something like this (on container):
const onSubmit = (data, dispatch) => (
dispatch(resourceCreateRequest('posts', data))
.then(...)
.catch((e) => {
throw new SubmissionError({ _error: e.message })
})
)
So I was messing around with using redux form in a new project and was curious why I couldn't get back the general error field ("_error") while using the _FAILURE actions.
I added the following in my sagas and the errors began returning:
yield put(actions.authLoginFailure(new SubmissionError({ _error: e.message }), request, thunk))
Does anyone know if this is best practice?