For example, the method “Create a user” in the documentation only written a status code and a summary.
https://auth0.com/docs/api/management/v2/users/post-users
However, I would like to know what format the object and error message text.
Moreover, the following error occurs when “Create a user” is executed from Node.js SDK, but it is not written in the documentation.
“errorName”: “Bad Request”,
“errorMessage”: “PasswordNoUserInfoError: Password contains user information”,
In “Amazon Cognito”, errors are named and error classes are created for each programming language.
Developers can implement error handling properly.
My hope is that eventually we will be able to handle this on a per error class basis like Amazon Cognito.
const auth0Client = new ManagementClient({
// ...
})
const createUserParam: CreateUserData = {
// ...
}
try {
await auth0Client.createUser(createUserParam)
} catch (err) {
if (err instanceof PasswordNoUserInfoError) {
// Handling for this error (e.g. Ask the user to enter the password again.)
}
}
What we want now is a list of error messages that can occur when executing “Create a user”