--effect-count string 影响的请求条数
--effect-percent string 影响的请求百分比
--exception string 异常类,带全包名,必须继承 java.lang.Exception 或 java.lang.Exception 本身
--exception-message string 指定异常类信息,默认值是 chaosblade-mock-exception
private String sayHello(String name) throws BeansException {
demoService = (DemoService)SpringContextUtil.getBean("demoService");
StringBuilder result = new StringBuilder();
result.append(demoService.sayHello(name));
return result.toString();
}
blade c jvm throwCustomException --exception java.lang.Exception --classname com.example.controller.DubboController --methodname sayHello --process tomcat --effect-count 2
{"code":200,"success":true,"result":"3abbe6fe97d6bc75"}
Q: java.lang.Throwable not assign from java.lang.Exception A: 配置 --exception 参数值 java.lang.Throwable,其不是 java.lang.Exception 的子类