-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AYS-660 | Change Error Code and Message for Already Passive Users (#436)
- Loading branch information
1 parent
8c3fe14
commit 83b2f09
Showing
11 changed files
with
240 additions
and
33 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/main/java/org/ays/auth/exception/AysUserAlreadyPassiveException.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.ays.auth.exception; | ||
|
||
import org.ays.common.exception.AysConflictException; | ||
|
||
import java.io.Serial; | ||
|
||
/** | ||
* Exception thrown when a user is already in a passive state. | ||
*/ | ||
public final class AysUserAlreadyPassiveException extends AysConflictException { | ||
|
||
/** | ||
* Unique identifier for serialization. | ||
*/ | ||
@Serial | ||
private static final long serialVersionUID = 2484662602911824448L; | ||
|
||
/** | ||
* Constructs a new {@link AysUserAlreadyPassiveException} with the specified detail message. | ||
*/ | ||
public AysUserAlreadyPassiveException() { | ||
super("user is already passive!"); | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/org/ays/auth/exception/AysUserNotActiveAuthException.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.ays.auth.exception; | ||
|
||
import org.ays.auth.model.enums.AysUserStatus; | ||
import org.ays.common.exception.AysAuthException; | ||
|
||
import java.io.Serial; | ||
|
||
/** | ||
* Exception thrown when attempting to authenticate a user that is not active. | ||
*/ | ||
public final class AysUserNotActiveAuthException extends AysAuthException { | ||
|
||
/** | ||
* Unique identifier for serialization. | ||
*/ | ||
@Serial | ||
private static final long serialVersionUID = -5218287176856317070L; | ||
|
||
/** | ||
* Constructs a new {@link AysUserNotActiveAuthException}with the specified userId. | ||
* | ||
* @param userId the id of the user that is not active. | ||
*/ | ||
public AysUserNotActiveAuthException(String userId) { | ||
super("user is not active! userId:" + userId); | ||
} | ||
|
||
/** | ||
* Constructs a new {@link AysUserNotActiveAuthException} with the specified user status. | ||
* | ||
* @param status the status of the user that is not active. | ||
*/ | ||
public AysUserNotActiveAuthException(AysUserStatus status) { | ||
super("user is not active! currentStatus: " + status.name()); | ||
} | ||
|
||
} |
22 changes: 6 additions & 16 deletions
22
src/main/java/org/ays/auth/exception/AysUserNotActiveException.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,27 @@ | ||
package org.ays.auth.exception; | ||
|
||
import org.ays.auth.model.enums.AysUserStatus; | ||
import org.ays.common.exception.AysAuthException; | ||
import org.ays.common.exception.AysConflictException; | ||
|
||
import java.io.Serial; | ||
|
||
/** | ||
* Exception thrown when attempting to authenticate a user that is not active. | ||
* Exception thrown when a user does not in an active state. | ||
*/ | ||
public final class AysUserNotActiveException extends AysAuthException { | ||
public final class AysUserNotActiveException extends AysConflictException { | ||
|
||
/** | ||
* Unique identifier for serialization. | ||
*/ | ||
@Serial | ||
private static final long serialVersionUID = -5218287176856317070L; | ||
private static final long serialVersionUID = 3508025652421021710L; | ||
|
||
/** | ||
* Constructs a new UserNotActiveException with the specified userId. | ||
* Constructs a new {@link AysUserNotActiveException} with the specified userId. | ||
* | ||
* @param userId the userId of the user that is not active | ||
* @param userId the id of the user that is not active. | ||
*/ | ||
public AysUserNotActiveException(String userId) { | ||
super("user is not active! userId:" + userId); | ||
} | ||
|
||
/** | ||
* Constructs a new UserNotActiveException with the specified user status. | ||
* | ||
* @param status the status of the user that is not active | ||
*/ | ||
public AysUserNotActiveException(AysUserStatus status) { | ||
super("user is not active! currentStatus: " + status.name()); | ||
} | ||
|
||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.