Skip to content

Commit

Permalink
Fix: CI/CD 배포 실패 해결하기 (#91)
Browse files Browse the repository at this point in the history
* #90 - feat: RuntimeException 핸들러 삭제

RuntimeException handler 가 있을 때
원하는 에러 메시지가 아니라
HV000028: Unexpected exception during isValid call 형태로 에러 메시지를 보내줌
임시로 지운다

* #90 - fix: 띄어쓰기 수정
  • Loading branch information
GGHDMS authored Feb 8, 2024
1 parent cfb639e commit 83d6026
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ jobs:
api.aladin.key: ${{ secrets.ALADIN_KEY }}
spring.jpa.hibernate.ddl-auto: ${{ secrets.DDL_AUTO }}
spring.servlet.multipart.location: ${{ secrets.LOCATION }}
cloud.aws.s3.credentials.access-key: ${{ secrets.AWS_ACCESS_KEY}}
cloud.aws.s3.credentials.secret-key: ${{ secrets.AWS_SECRET_KEY}}
cloud.aws.s3.credentials.access-key: ${{ secrets.AWS_ACCESS_KEY }}
cloud.aws.s3.credentials.secret-key: ${{ secrets.AWS_SECRET_KEY }}

- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.multipart.MultipartException;

import java.time.LocalDateTime;

@Slf4j
@ControllerAdvice
@RestControllerAdvice
public class GlobalControllerAdvice {

@ExceptionHandler(DuplicateKeyException.class)
Expand Down Expand Up @@ -47,7 +47,7 @@ public ResponseEntity<ErrorResponse> handleEntityNotFoundException(EntityNotFoun
log.error("EntityNotFoundException occurred: {}", ex.getMessage());
ErrorResponse errorResponse = new ErrorResponse(
LocalDateTime.now(),
HttpStatus.BAD_REQUEST,
HttpStatus.NOT_FOUND,
ex.getMessage(),
request.getRequestURI()
);
Expand Down Expand Up @@ -90,15 +90,6 @@ public ResponseEntity<ErrorResponse> handleMultipartException(MultipartException
return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST);
}

@ExceptionHandler(RuntimeException.class)
public ResponseEntity<ErrorResponse> handleRunTimeException(RuntimeException ex, HttpServletRequest request) {
log.error("handleRuntimeException occurred: {}", ex.getMessage());
ErrorResponse errorResponse = new ErrorResponse(
LocalDateTime.now(),
HttpStatus.BAD_REQUEST,
ex.getMessage(),
request.getRequestURI()
);
return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST);
}
//TODO RunTimeExceptionHandler 사용시 HV000028: Unexpected exception during isValid call 발생 이유를 찾고 해결하자

}

0 comments on commit 83d6026

Please sign in to comment.