HappyWeasel
Spring - HttpServletResponse error 반환시 message가 비어서 올 때 본문
Back-End/Spring
Spring - HttpServletResponse error 반환시 message가 비어서 올 때
HappyWeasel 2021. 1. 20. 14:37@ResponseStatus(value= HttpStatus.UNAUTHORIZED)
public class UnauthorizedException extends RuntimeException {
public UnauthorizedException(String message) {
super(message);
}
}
message가 비어서 온다.
{
"timestamp": "2020-05-27T13:44:58.032+00:00",
"status": 401,
"error": "Unauthorized",
"message": "",
"path": "/auth/register"
}
이런 경우에는 yml에 아래와 같이 설정해준다.
server:
error:
include-message: always
include-binding-errors: always
'Back-End > Spring' 카테고리의 다른 글
Spring Boot - cloud Hystrix (0) | 2021.01.26 |
---|---|
Spring Boot - Embedded Tomcat Container 추가 설정 (0) | 2021.01.26 |
Spring Boot - Audit 시 생성자, 편집자 이름 저장 (0) | 2021.01.19 |
JPA - CASCADE TYPE (0) | 2021.01.14 |
Spring Boot - JPA Infinite recursion (0) | 2021.01.12 |
Comments