What's the right way to break out of this chain? Like, if I'm in the catch, I don't want the following two then
s to execute.
I used to have the catch
last, but moved it up, thinking it might help. It didn't.
return axios
.post(url, data)
.catch(error => {
const message = getBannerTextFailureMessage(liability, toStatus)
dispatch(showBanner(message, bannerConstants.typeError))
})
.then(response => {
return dispatch(updateLiabilitiesComplete())
})
.then(response => {
const message = getBannerTextSuccessMessage(liability, toStatus)
dispatch(showBanner(message, bannerConstants.typeSuccess))
})