Skip to content

Commit

Permalink
Fix Broken Exception Handling Message (MethodArgumentNotValidException)
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Diger committed Dec 30, 2023
1 parent d4f5523 commit e5e0713
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ class ApiExceptionHandler {

@ExceptionHandler(MethodArgumentNotValidException::class)
private fun handlerMethodArgumentNotValidException(
exception: MethodArgumentNotValidException,
request: WebRequest
exception: MethodArgumentNotValidException
): Response<Any> {
val error = exception.fieldErrors.map { error -> error.defaultMessage }.toString()
return Response.fail(
exceptionCode = E400_BAD_REQUEST,
detailMessage = error
detailMessage = exception.fieldErrors[0].defaultMessage
)
}

Expand Down

0 comments on commit e5e0713

Please sign in to comment.