Created
June 17, 2019 19:34
-
-
Save sebastienvermeille/1d45cb456a1e5040161efbea520b40b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public UserService { | |
public User register( | |
@NonNull final String username, | |
@NonNull final String plainPassword, | |
@NonNull final Email email, | |
@NonNull final LocalDate birthDate, | |
@NonNull final Gender gender) throws UnableToSaveUserException {} | |
} | |
// multiple exception can occurs as source of UnableToSaveUserException | |
public class UnableToSaveUserException extends Exception {} | |
public class UsernameAlreadyRegisteredException extends UnableToSaveUserException {} | |
public class EmailAlreadyRegisteredException extends UnableToSaveUserException {} | |
public class NotWellFormedUserDtoException extends UnableToSaveUserException {} | |
public class UserNotAuthorizedToPerformOperation extends RuntimeException {} // should it be a checked exception ???? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment