[SalesForce] Customize the Duplicate Username error message in a Community

When a Community user tries to register using an email address that already exists in the system (using self-registration), they receive a very generic error message:

"Your request cannot be processed at this time. The site administrator has been alerted."

Does anyone know how we can customize this error message (via code or anything else) to rather display something like this:

"Oops! Looks like you're trying to register with an email address that is already associated with a User. Please go back to the login page and log in with the email address and your existing password."

Best Answer

Its not in the controller. Since you have a Lightning Community, the error messages are controlled by Lightning Components. See this help page and the image below for more.

Community Login Setup Page