I'm using the Cognito Javascript SDK and created a form where a user can register an Account. If for any reason, server-side validation fails, the response to it is like below:
{
"__type":"InvalidParameterException",
"message":"4 validation errors detected: Value at 'password' failed to satisfy constraint: Member must have length greater than or equal to 6; Value at 'password' failed to satisfy constraint: Member must satisfy regular expression pattern: [\\S]+; Value at 'username' failed to satisfy constraint: Member must have length greater than or equal to 1; Value at 'username' failed to satisfy constraint: Member must satisfy regular expression pattern: [\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}]+"
}
The issue with the response is that I cannot provide a good user feedback because I'd have to parse the response to determine which fields need to be fixed. Is there any way to get the errors back in a format which is better for working in a programmatic manner?