[feat](log) Update RestApiExceptionHandler log level from debug to warn (#30306)

* When meeting RestApiExceptionHandler, we have insufficient information
  for finding out the call stack
This commit is contained in:
Lei Zhang
2024-01-25 18:22:42 +08:00
committed by yiguolei
parent 2ecc6ed0d4
commit ce0b4fed6d

View File

@ -37,28 +37,28 @@ public class RestApiExceptionHandler {
@ExceptionHandler(UnauthorizedException.class)
@ResponseBody
public Object unauthorizedHandler(UnauthorizedException e) {
LOG.debug("unauthorized exception", e);
LOG.warn("unauthorized exception", e);
return ResponseEntityBuilder.unauthorized(e.getMessage());
}
@ExceptionHandler(UserException.class)
@ResponseBody
public Object userExceptionHandler(UserException e) {
LOG.debug("user exception", e);
LOG.warn("user exception", e);
return ResponseEntityBuilder.ok(e.getMessage());
}
@ExceptionHandler(BadRequestException.class)
@ResponseBody
public Object badRequestExceptionHandler(BadRequestException e) {
LOG.debug("bad request exception", e);
LOG.warn("bad request exception", e);
return ResponseEntityBuilder.badRequest(e.getMessage());
}
@ExceptionHandler(Exception.class)
@ResponseBody
public Object unexpectedExceptionHandler(Exception e) {
LOG.debug("unexpected exception", e);
LOG.warn("unexpected exception", e);
return ResponseEntityBuilder.internalError(e.getMessage());
}
}