* fix #9655 ExceptionHandler order bug * Change GlobalExceptionHandler order
This commit is contained in:
parent
014eb69b46
commit
2d317227b3
@ -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 {
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user