c
c
chaosblade-help-zh-CN
Search…
c
c
chaosblade-help-zh-CN
README
blade
blade create
blade create cpu load
blade create disk burn
blade create disk fill
blade create mem load
blade create network delay
blade create network dns
blade create network drop
blade create network loss
blade create network corrupt
blade create network reorder
blade create network duplicate
blade create network occupy
blade create process kill
blade create process stop
blade create script delay
blade create script exit
blade create docker
blade create k8s
blade prepare jvm
blade create jvm
blade create servlet
blade create servlet delay
blade create servlet throwCustomException
blade server
blade status
blade version
Powered By
GitBook
blade create servlet throwCustomException
介绍
Java web 请求异常
参数
以下是此场景特有参数,通用参数详见:[blade create servlet](blade create servlet.md)
1
--exception string 异常类,带全包名,必须继承 java.lang.Exception 或 java.lang.Exception 本身
2
--exception-message string 指定异常类信息,默认值是 chaosblade-mock-exception
Copied!
案例
访问 http://localhost:8080/dubbodemo/hello?code=1 请求异常,影响 3 条请求
1
blade c servlet throwCustomException --exception org.springframework.beans.BeansException --exception-message mock-beans-exception --requestpath /hello --effect-count 3
2
3
{"code":200,"success":true,"result":"d4a63f4f59f76f4a"}
Copied!
访问请求进行验证。
查看日志,通过日志也可以看出
实验原理
常见问题
Previous
blade create servlet delay
Next
blade server
Last modified
8mo ago
Copy link
Contents
介绍
参数
案例
实验原理
常见问题