Skip to content

Commit

Permalink
Api-v0.0.3-6
Browse files Browse the repository at this point in the history
  • Loading branch information
kdomo committed Jul 8, 2023
2 parents 70bf8f9 + 67aa4c2 commit 3fc92c6
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class GlobalExceptionHandler : ResponseEntityExceptionHandler() {
status: HttpStatus,
request: WebRequest,
): ResponseEntity<Any> {
logger.error("Exception", ex)
val servletWebRequest = request as ServletWebRequest
val url = UriComponentsBuilder.fromHttpRequest(
ServletServerHttpRequest(servletWebRequest.request),
Expand All @@ -60,6 +61,7 @@ class GlobalExceptionHandler : ResponseEntityExceptionHandler() {
status: HttpStatus,
request: WebRequest,
): ResponseEntity<Any> {
logger.error("MethodArgumentNotValidException Exception", ex)
val url = UriComponentsBuilder.fromHttpRequest(
ServletServerHttpRequest((request as ServletWebRequest).request),
)
Expand All @@ -84,6 +86,7 @@ class GlobalExceptionHandler : ResponseEntityExceptionHandler() {
e: ConstraintViolationException,
request: HttpServletRequest,
): ResponseEntity<ErrorResponse?>? {
logger.error("ConstraintViolationException Exception", e)
val bindingErrors: MutableMap<String?, Any> = HashMap()
e.constraintViolations.forEach {
constraintViolation ->
Expand All @@ -106,6 +109,7 @@ class GlobalExceptionHandler : ResponseEntityExceptionHandler() {
e: WhatNowDynamicException,
request: HttpServletRequest,
): ResponseEntity<ErrorResponse?>? {
logger.error("WhatnowDynamicException Exception", e)
val errorResponse = ErrorResponse(
e.status,
e.code,
Expand All @@ -120,6 +124,7 @@ class GlobalExceptionHandler : ResponseEntityExceptionHandler() {
e: WhatnowCodeException,
request: HttpServletRequest,
): ResponseEntity<ErrorResponse?>? {
logger.error("WhatnowCodeException Exception", e)
// val code: BaseErrorCode? = e.errorCode
val errorReason: ErrorReason = e.errorReason
val errorResponse = ErrorResponse.of(errorReason, request.requestURL.toString())
Expand All @@ -132,6 +137,7 @@ class GlobalExceptionHandler : ResponseEntityExceptionHandler() {
e: Exception,
request: HttpServletRequest?,
): ResponseEntity<ErrorResponse?> {
logger.error("Exception", e)
// val cachingRequest = request as ContentCachingRequestWrapper?
val cachingRequest = request as ContentCachingRequestWrapper
val userId: Long = SecurityUtils.currentUserId
Expand Down

0 comments on commit 3fc92c6

Please sign in to comment.