feat: Dedicated exception on user creation

This commit is contained in:
Piotr Dec 2024-05-22 19:21:26 +02:00
parent 52ae2789fc
commit c7ef32e28d
Signed by: stawros
GPG key ID: F89F27AD8F881A91
3 changed files with 22 additions and 3 deletions

View file

@ -0,0 +1,11 @@
package eu.ztsh.wymiana.exception;
import eu.ztsh.wymiana.web.model.UserCreateRequest;
public class UserAlreadyExistsException extends RuntimeException {
public UserAlreadyExistsException(UserCreateRequest entity) {
super("User with PESEL %s already exists".formatted(entity.pesel()));
}
}