原文: https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-error-handling
原文中有这么一段

其中:
if YourException is thrown by a controller defined in the same package as AcmeController
这个 defined 修饰的是 controller 还是 YourException 。。?
假如我有个 a,b,c 三个 module, a 和 b 都依赖 c. c 中有一个异常 CException
public class CException extends RuntimeException {}
分别在 a 和 b 中的某个 controller 抛出, 并且 a 和 b 中分别定义了 ControllerAdvice
@ControllerAdvice(basePackageClasses = AController.class)
public class AControllerAdvice {
@ExceptionHandler(CException.class)
public ResponseEntity handleCException() {
// ...
}
}
@ControllerAdvice(basePackageClasses = BController.class)
public class BControllerAdvice {
@ExceptionHandler(CException.class)
public ResponseEntity handleCException() {
// ...
}
}
哪个 advice 能拦截到? 还是说要根据 order 来判断..?