[ISSUE #9655] fix ExceptionHandler order bug (#9657)

* fix #9655 ExceptionHandler order bug

* Change GlobalExceptionHandler order
This commit is contained in:
zhanghong 2022-12-03 19:24:39 +08:00 committed by GitHub
parent 014eb69b46
commit 2d317227b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View File

@ -19,7 +19,6 @@ package com.alibaba.nacos.config.server.exception;
import com.alibaba.nacos.api.exception.NacosException;
import com.alibaba.nacos.common.utils.ExceptionUtil;
import com.alibaba.nacos.config.server.monitor.MetricsMonitor;
import org.springframework.core.annotation.Order;
import org.springframework.dao.DataAccessException;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
@ -32,7 +31,6 @@ import java.io.IOException;
*
* @author Nacos
*/
@Order(0)
@ControllerAdvice
public class GlobalExceptionHandler {

View File

@ -42,6 +42,7 @@ public class ConsoleExceptionHandler {
@ExceptionHandler(AccessException.class)
private ResponseEntity<String> handleAccessException(AccessException e) {
LOGGER.error("got exception. {}", e.getErrMsg());
return ResponseEntity.status(HttpStatus.FORBIDDEN).body(e.getErrMsg());
}