generated from pricelees/issue-pr-template
[#56] 예약 & 결제 프로세스 및 패키지 구조 재정의 #57
@ -30,7 +30,7 @@ class GlobalExceptionHandler(
|
||||
val httpStatus: HttpStatus = errorCode.httpStatus
|
||||
val errorResponse = CommonErrorResponse(errorCode)
|
||||
|
||||
logException(servletRequest, httpStatus, errorResponse, e)
|
||||
log.info { convertExceptionLogMessage(servletRequest, httpStatus, errorResponse, e) }
|
||||
|
||||
return ResponseEntity
|
||||
.status(httpStatus.value())
|
||||
@ -56,7 +56,7 @@ class GlobalExceptionHandler(
|
||||
val httpStatus: HttpStatus = errorCode.httpStatus
|
||||
val errorResponse = CommonErrorResponse(errorCode)
|
||||
|
||||
logException(servletRequest, httpStatus, errorResponse, e)
|
||||
log.warn { convertExceptionLogMessage(servletRequest, httpStatus, errorResponse, e) }
|
||||
|
||||
return ResponseEntity
|
||||
.status(httpStatus.value())
|
||||
@ -74,28 +74,26 @@ class GlobalExceptionHandler(
|
||||
val httpStatus: HttpStatus = errorCode.httpStatus
|
||||
val errorResponse = CommonErrorResponse(errorCode)
|
||||
|
||||
logException(servletRequest, httpStatus, errorResponse, e)
|
||||
log.warn { convertExceptionLogMessage(servletRequest, httpStatus, errorResponse, e) }
|
||||
|
||||
return ResponseEntity
|
||||
.status(httpStatus.value())
|
||||
.body(errorResponse)
|
||||
}
|
||||
|
||||
private fun logException(
|
||||
private fun convertExceptionLogMessage(
|
||||
servletRequest: HttpServletRequest,
|
||||
httpStatus: HttpStatus,
|
||||
errorResponse: CommonErrorResponse,
|
||||
exception: Exception
|
||||
) {
|
||||
): String {
|
||||
val actualException: Exception? = if (errorResponse.message == exception.message) null else exception
|
||||
|
||||
val logMessage = messageConverter.convertToErrorResponseMessage(
|
||||
return messageConverter.convertToErrorResponseMessage(
|
||||
servletRequest = servletRequest,
|
||||
httpStatus = httpStatus,
|
||||
responseBody = errorResponse,
|
||||
exception = actualException
|
||||
)
|
||||
|
||||
log.warn { logMessage }
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user