More robust error handling
This commit is contained in:
parent
c0ac1719a1
commit
88277d2d3f
2 changed files with 13 additions and 6 deletions
|
|
@ -27,7 +27,11 @@ const LoginComponent = ({
|
|||
const submit = (evt) => {
|
||||
evt.preventDefault();
|
||||
|
||||
postLogin(state).catch((ex) => {
|
||||
postLogin(state).then((resp) => {
|
||||
if (resp.status !== 200) {
|
||||
setError(`${resp.data}`);
|
||||
}
|
||||
}).catch((ex) => {
|
||||
setError(`${ex.response.data}`);
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue