-
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.
enhancement(app): cleaned up the code of app resource and services
- Loading branch information
1 parent
ca69d0c
commit 6bfba18
Showing
7 changed files
with
111 additions
and
78 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
server/src/main/java/dev/shiperist/exception/ErrorMessageException.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,13 @@ | ||
package dev.shiperist.exception; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public class ErrorMessageException extends RuntimeException{ | ||
|
||
private final ErrorMessage errorMessage; | ||
|
||
public ErrorMessageException(ErrorMessage errorMessage) { | ||
this.errorMessage = errorMessage; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
server/src/main/java/dev/shiperist/exception/ErrorMessageHandler.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,13 @@ | ||
package dev.shiperist.exception; | ||
|
||
import jakarta.ws.rs.core.Response; | ||
import jakarta.ws.rs.ext.ExceptionMapper; | ||
import jakarta.ws.rs.ext.Provider; | ||
|
||
@Provider | ||
public class ErrorMessageHandler implements ExceptionMapper<ErrorMessageException> { | ||
@Override | ||
public Response toResponse(ErrorMessageException e) { | ||
return Response.status(Response.Status.BAD_REQUEST).entity(e.getErrorMessage()).build(); | ||
} | ||
} |
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