Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 각 도메인 별 ErrorAdvice를 common 패키지의 error 패키지로 이관 - 각 도메인 별 Exception은 도메인 패키지의 exception 패키지에 응집
- Loading branch information
Showing
47 changed files
with
193 additions
and
227 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
app/src/main/java/com/codesoom/assignment/common/auth/AuthenticationInterceptor.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
2 changes: 1 addition & 1 deletion
2
...nment/common/exception/ErrorResponse.java → ...ssignment/common/error/ErrorResponse.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
10 changes: 4 additions & 6 deletions
10
...mon/exception/GlobalExceptionHandler.java → ...nment/common/error/GlobalErrorAdvice.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
23 changes: 23 additions & 0 deletions
23
app/src/main/java/com/codesoom/assignment/common/error/ProductErrorAdvice.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,23 @@ | ||
package com.codesoom.assignment.common.error; | ||
|
||
import com.codesoom.assignment.product.exception.ProductNotFoundException; | ||
import com.codesoom.assignment.product.presentation.ProductController; | ||
import org.springframework.core.Ordered; | ||
import org.springframework.core.annotation.Order; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.ExceptionHandler; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
import org.springframework.web.bind.annotation.RestControllerAdvice; | ||
|
||
@RestControllerAdvice(basePackageClasses = { | ||
ProductController.class | ||
}) | ||
@Order(Ordered.HIGHEST_PRECEDENCE) | ||
public class ProductErrorAdvice { | ||
|
||
@ResponseStatus(HttpStatus.NOT_FOUND) | ||
@ExceptionHandler(ProductNotFoundException.class) | ||
public ErrorResponse handleProductNotFound() { | ||
return new ErrorResponse("Product not found"); | ||
} | ||
} |
16 changes: 12 additions & 4 deletions
16
...on/exception/SessionExceptionHandler.java → ...ment/common/error/SessionErrorAdvice.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
19 changes: 15 additions & 4 deletions
19
.../user/exception/UserExceptionHandler.java → ...ignment/common/error/UserErrorAdvice.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
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
20 changes: 0 additions & 20 deletions
20
app/src/main/java/com/codesoom/assignment/domain/product/exception/ProductErrorAdvice.java
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
...c/main/java/com/codesoom/assignment/domain/product/exception/ProductExceptionHandler.java
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
app/src/main/java/com/codesoom/assignment/domain/session/exception/SessionErrorAdvice.java
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
app/src/main/java/com/codesoom/assignment/domain/user/exception/UserErrorAdvice.java
This file was deleted.
Oops, something went wrong.
10 changes: 5 additions & 5 deletions
10
...n/product/application/ProductService.java → ...t/product/application/ProductService.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
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
2 changes: 1 addition & 1 deletion
2
...ain/product/domain/ProductRepository.java → ...ent/product/domain/ProductRepository.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
2 changes: 1 addition & 1 deletion
2
...t/exception/ProductNotFoundException.java → ...t/exception/ProductNotFoundException.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
6 changes: 3 additions & 3 deletions
6
...n/product/infra/JpaProductRepository.java → ...t/product/infra/JpaProductRepository.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
8 changes: 4 additions & 4 deletions
8
...oduct/presentation/ProductController.java → ...oduct/presentation/ProductController.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
8 changes: 6 additions & 2 deletions
8
...product/presentation/dto/ProductData.java → ...product/presentation/dto/ProductData.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
12 changes: 6 additions & 6 deletions
12
...on/application/AuthenticationService.java → ...on/application/AuthenticationService.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
8 changes: 4 additions & 4 deletions
8
...session/controller/SessionController.java → ...session/controller/SessionController.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
2 changes: 1 addition & 1 deletion
2
...ion/controller/dto/SessionRequestDto.java → ...ion/controller/dto/SessionRequestDto.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
2 changes: 1 addition & 1 deletion
2
...on/controller/dto/SessionResponseDto.java → ...on/controller/dto/SessionResponseDto.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
2 changes: 1 addition & 1 deletion
2
...sion/exception/InvalidTokenException.java → ...sion/exception/InvalidTokenException.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
2 changes: 1 addition & 1 deletion
2
...ion/exception/TokenNotExistException.java → ...ion/exception/TokenNotExistException.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
16 changes: 8 additions & 8 deletions
16
.../domain/user/application/UserService.java → ...ignment/user/application/UserService.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
Oops, something went wrong.