Skip to content

Commit

Permalink
�� Runtime���몄� �¢�� 濡帷렇瑜� 蹂쇱��寃� �ㅼ� 異�
Browse files Browse the repository at this point in the history
  • Loading branch information
youngreal committed Sep 5, 2024
1 parent 53ed12b commit 379086a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
import com.dnd.dndtravel.map.exception.PhotoInvalidException;
import com.dnd.dndtravel.map.exception.PhotoUploadFailException;
import com.dnd.dndtravel.map.exception.RegionNotFoundException;

import lombok.extern.slf4j.Slf4j;

//todo 예외클래스가 많아지면 해당클래스가 길어질것으로 예상, 개선필요해보이고 보안 때문에 상태코드별로 애매하게 동일한 메시지를 전달해주고, 스웨거 문서로 상세 오류를 전달해주는데 이 구조가 적절한건지 고민해봐야한다.
@Slf4j
@RestControllerAdvice
public class CommonExceptionHandler {

Expand Down Expand Up @@ -111,13 +115,15 @@ public ResponseEntity<String> runtimeException(PhotoInvalidException e) {

@ExceptionHandler(RuntimeException.class)
public ResponseEntity<String> runtimeException(RuntimeException e) {
log.error("runtimeException = {}", e);
return ResponseEntity
.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(INTERNAL_SERVER_ERROR_MESSAGE);
}

@ExceptionHandler(Exception.class)
public ResponseEntity<String> runtimeException(Exception e) {
log.error("exception = {}", e);
return ResponseEntity
.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(INTERNAL_SERVER_ERROR_MESSAGE);
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ spring:
hibernate:
format_sql: true

logging:
level:
root: INFO # 로그 레벨 설정

social-login:
provider:
apple:
Expand Down

0 comments on commit 379086a

Please sign in to comment.