| | |
| | | import javax.annotation.Nonnull; |
| | | import javax.annotation.Nullable; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.pollex.pam.business.service.UsernameAlreadyUsedException; |
| | | import com.pollex.pam.business.web.errors.*; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.core.env.Environment; |
| | |
| | | |
| | | @ExceptionHandler |
| | | public ResponseEntity<Problem> handleEmailAlreadyUsedException( |
| | | com.pollex.pam.service.EmailAlreadyUsedException ex, |
| | | com.pollex.pam.business.service.EmailAlreadyUsedException ex, |
| | | NativeWebRequest request |
| | | ) { |
| | | EmailAlreadyUsedException problem = new EmailAlreadyUsedException(); |
| | |
| | | |
| | | @ExceptionHandler |
| | | public ResponseEntity<Problem> handleUsernameAlreadyUsedException( |
| | | com.pollex.pam.service.UsernameAlreadyUsedException ex, |
| | | UsernameAlreadyUsedException ex, |
| | | NativeWebRequest request |
| | | ) { |
| | | LoginAlreadyUsedException problem = new LoginAlreadyUsedException(); |
| | |
| | | |
| | | @ExceptionHandler |
| | | public ResponseEntity<Problem> handleInvalidPasswordException( |
| | | com.pollex.pam.service.InvalidPasswordException ex, |
| | | com.pollex.pam.business.service.InvalidPasswordException ex, |
| | | NativeWebRequest request |
| | | ) { |
| | | return create(new InvalidPasswordException(), request); |