Package com.restapi.template.errorbot
Class UnhandledExceptionController
- java.lang.Object
-
- com.restapi.template.errorbot.UnhandledExceptionController
-
@ControllerAdvice public class UnhandledExceptionController extends java.lang.Object처리되지 않은 예외를 로깅하고, 보고하기 위한 Exception Handler.- Version:
- 1.0
- Author:
- always0ne
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Loggerlogger
-
Constructor Summary
Constructors Constructor Description UnhandledExceptionController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidlogging(java.lang.Throwable throwable)ERROR 레벨로 로그 남기기.ErrorResponsereportError(java.lang.Throwable throwable)걸러지지 않은 예외 로깅.
-
-
-
Method Detail
-
reportError
@ExceptionHandler(java.lang.Throwable.class) @ResponseStatus(INTERNAL_SERVER_ERROR) @ResponseBody public ErrorResponse reportError(java.lang.Throwable throwable)
걸러지지 않은 예외 로깅.- Parameters:
throwable- 걸러지지 않은 예외- Returns:
- ErrorResponse
-
logging
protected void logging(java.lang.Throwable throwable)
ERROR 레벨로 로그 남기기.- Parameters:
throwable- 걸러지지 않은 예외
-
-