p5.js version
2.3.2
What is your operating system?
Linux
Web browser and version
firefox 153.0.1
Actual Behavior
If the signup request fails because of a network error, the signup form gets stuck in the submitting state indefinitely.
the error handler in validateAndSignUpUser() assumes that error.response always exists and tries to access response.data.error. for network errors, axios doesn't provide a response object, so this throws a TypeError before the promise can resolve.
i get:
TypeError: Cannot read properties of undefined (reading 'data')
the form stays stuck in the submitting state instead of showing an error or finishing the submission.
Expected Behavior
If the signup request fails because of a network error, the error should be handled gracefully and the signup form should stop submitting and show an appropriate error message.
Steps to reproduce
- open the p5.js web editor and go to the signup page
- enter valid signup details
- make the POST /signup request fail with a network error, for example by disconnecting the network or blocking the request
- submit the form
- notice that the form stays in the submitting state and no useful error is shown
Snippet:
.catch((error) => {
const { response } = error;
dispatch(authError(response.data.error));
resolve({ error });
});
p5.js version
2.3.2
What is your operating system?
Linux
Web browser and version
firefox 153.0.1
Actual Behavior
If the signup request fails because of a network error, the signup form gets stuck in the submitting state indefinitely.
the error handler in validateAndSignUpUser() assumes that error.response always exists and tries to access response.data.error. for network errors, axios doesn't provide a response object, so this throws a TypeError before the promise can resolve.
i get:
TypeError: Cannot read properties of undefined (reading 'data')
the form stays stuck in the submitting state instead of showing an error or finishing the submission.
Expected Behavior
If the signup request fails because of a network error, the error should be handled gracefully and the signup form should stop submitting and show an appropriate error message.
Steps to reproduce
Snippet: