Remove unused http error codes
This commit is contained in:
parent
3549fc5fdd
commit
a3128cee35
1 changed files with 3 additions and 17 deletions
|
@ -5,26 +5,12 @@ import router from '../routes';
|
||||||
|
|
||||||
const parseErrorCode = error => {
|
const parseErrorCode = error => {
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
if (error.response.status === 401) {
|
// 901, 902 are used to identify billing related issues
|
||||||
// If auth failed
|
if ([901, 902].includes(error.response.status)) {
|
||||||
} else if (error.response.status === 500) {
|
const name = Auth.isAdmin() ? 'billing' : 'billing_deactivated';
|
||||||
// If server failed
|
|
||||||
} else if (error.response.status === 422) {
|
|
||||||
// If request params are errored
|
|
||||||
} else if (error.response.status === 901 || error.response.status === 902) {
|
|
||||||
let name = 'billing_deactivated';
|
|
||||||
if (Auth.isAdmin()) {
|
|
||||||
name = 'billing';
|
|
||||||
}
|
|
||||||
// If Trial ended
|
|
||||||
router.push({ name });
|
router.push({ name });
|
||||||
} else {
|
|
||||||
// Anything else
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// Something happened in setting up the request that triggered an Error
|
|
||||||
}
|
}
|
||||||
// Do something with request error
|
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue