-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Task 22 : Define UserNotFoundException
- Loading branch information
1 parent
b1a06c9
commit 361ad05
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/main/java/com/springboot/ratelimiter/common/exception/user/UserNotFoundException.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,26 @@ | ||
package com.springboot.ratelimiter.common.exception.user; | ||
|
||
import com.springboot.ratelimiter.common.exception.NotFoundException; | ||
|
||
import java.io.Serial; | ||
|
||
public class UserNotFoundException extends NotFoundException { | ||
|
||
@Serial | ||
private static final long serialVersionUID = -5868536504664147877L; | ||
|
||
private static final String DEFAULT_MESSAGE = | ||
"The specified user is not found"; | ||
|
||
private static final String MESSAGE_TEMPLATE = | ||
"No user was found with ID: "; | ||
|
||
public UserNotFoundException(String id) { | ||
super(MESSAGE_TEMPLATE.concat(id)); | ||
} | ||
|
||
public UserNotFoundException() { | ||
super(DEFAULT_MESSAGE); | ||
} | ||
|
||
} |