handler

JVM/Spring

[Spring] Exception 어떻게 처리할까?

🤔 서론 Exception Handler 를 구현하다 리펙토링 한 경험을 작성합니다. 🫢 본론 기존 Exception 은 상황에 맞게 각각 Custom Exception 을 만들어서 처리를 했습니다. 문제점 Exception 마다 각각의 Handler 를 만들어주어야 했습니다. 클래스는 통합해서 작성해도 되지만, 여기서 중요한 건 만든 각각의 Custom Exception 별로 별도의 Handler를 추가로 계속 작성해주어야만 했습니다. 중복된 코드 private static final String MESSAGE = "패스워드가 일치하지 않습니다"; @ExceptionHandler(value = {PasswordMismatchException.class, BadCredentialsException.cla..

Hyo Kim
'handler' 태그의 글 목록