Не могли бы вы мне объяснить, почему этот код можно завершить с помощью Uncaught TypeError: Cannot read property 'catch' of undefined
, когда у меня в качестве последнего оператора window.location.reload();
в блоке catch?
changeLocale(locale) {
return this.get('backend').changeLocale(locale).then((data) => {
return this.get('backend').doSomethingOther();
}).catch((e) => {
if (e && e.errorData && e.errorData[0].errorCode === AUTH_FAILED_ERR_CODE) {
// if authorizationFailed - change locale cookie and reload
this._bakeCookie(locale);
window.location.reload();
} else {
return Promise.reject();
}
});
}