I'm using Spring security. Is there any dedicated spring authentication exception type for the case where user wants to signup with a username that already exists?
The closest exception that I could find to my intention was AuthenticationServiceException that according to spring doc is "Thrown if an authentication request could not be processed due to a system problem."
You can use this UserAlreadyExistAuthenticationException
Example Class:
public class UserAlreadyExistAuthenticationException extends AuthenticationException {
public UserAlreadyExistAuthenticationException(final String msg) {
super(msg);
}
}