You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "fuchanghai (via GitHub)" <gi...@apache.org> on 2024/01/08 04:05:37 UTC
Re: [PR] [improvement-#15257][API] update http state code [dolphinscheduler]
fuchanghai commented on code in PR #15258:
URL: https://github.com/apache/dolphinscheduler/pull/15258#discussion_r1444158675
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/exceptions/ApiExceptionHandler.java:
##########
@@ -36,12 +38,14 @@
public class ApiExceptionHandler {
@ExceptionHandler(ServiceException.class)
+ @ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
public Result<Object> exceptionHandler(ServiceException e, HandlerMethod hm) {
log.error("{} Meet a ServiceException: {}", hm.getShortLogMessage(), e.getMessage());
return new Result<>(e.getCode(), e.getMessage());
}
@ExceptionHandler(Throwable.class)
+ @ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
Review Comment:
hi @EricGao888 I think under normal circumstances this error is a back-end business error, so I think using 5xx is sound good to me ,WDYT ?cc @caishunfeng
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org