Skip to content

Commit

Permalink
Handle Sign Up error
Browse files Browse the repository at this point in the history
  • Loading branch information
RodriSanchez1 committed Sep 1, 2023
1 parent 3135ecb commit 35a00ab
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/Account/SignUp/SignUp.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,16 @@ export class SignUp extends Component {

signUp(formValues)
.then(signUpStatus => this.setState({ signUpStatus }))
.catch(signUpStatus => this.setState({ signUpStatus }))
.catch(error => {
const responseMessage = error?.response?.data?.message;
const message = responseMessage
? responseMessage
: this.props.intl.formatMessage(messages.noConnection);

this.setState({
signUpStatus: { success: false, message: message }
});
})
.finally(() => this.setState({ isSigningUp: false }));
};

Expand Down

0 comments on commit 35a00ab

Please sign in to comment.