Skip to content

Commit

Permalink
refactor(ExceptionHandler): 일부 에러 코드에 대한 응답 변경 (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
limehee authored May 5, 2024
1 parent 0835f4f commit 17f0cc1
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.concurrent.CompletionException;

Expand All @@ -88,9 +86,9 @@ public class GlobalExceptionHandler {
MethodArgumentTypeMismatchException.class,
IllegalAccessException.class,
})
public ApiResponse badRequestException(HttpServletResponse response, Exception e) {
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
return ApiResponse.failure();
public ErrorResponse badRequestException(HttpServletResponse response, Exception e) {
response.setStatus(HttpServletResponse.SC_OK);
return ErrorResponse.failure(e);
}

@ExceptionHandler({
Expand Down Expand Up @@ -126,9 +124,9 @@ public ApiResponse deniedException(HttpServletResponse response, Exception e) {
NoSuchElementException.class,
FileNotFoundException.class,
})
public ApiResponse<List<?>> notFoundException(HttpServletResponse response, Exception e) {
public ErrorResponse notFoundException(HttpServletResponse response, Exception e) {
response.setStatus(HttpServletResponse.SC_OK);
return ApiResponse.success(new ArrayList<>());
return ErrorResponse.failure(e);
}

@ExceptionHandler({
Expand Down

0 comments on commit 17f0cc1

Please sign in to comment.