Skip to content

Commit fdd331c

Browse files
committed
feat: 에러코드 반영
1 parent aa0969b commit fdd331c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/kotlin/com/depromeet/makers/config/WebExceptionHandler.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.depromeet.makers.config
22

33
import com.depromeet.makers.domain.exception.DomainException
4+
import com.depromeet.makers.domain.exception.ErrorCode
45
import com.depromeet.makers.presentation.web.dto.response.ErrorResponse
56
import org.springframework.http.HttpStatus
67
import org.springframework.http.ResponseEntity
@@ -23,7 +24,8 @@ class WebExceptionHandler {
2324
@ExceptionHandler
2425
fun handleUnhandledException(e: Exception): ResponseEntity<ErrorResponse> {
2526
e.printStackTrace()
26-
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
27-
.body(ErrorResponse(0, ""))
27+
return ResponseEntity
28+
.status(HttpStatus.INTERNAL_SERVER_ERROR)
29+
.body(ErrorResponse(ErrorCode.INTERNAL_ERROR.code, ErrorCode.INTERNAL_ERROR.message))
2830
}
2931
}

0 commit comments

Comments
 (0)