chaojunma / blog-comments

博客评论
0 stars 0 forks source link

Sentinel自定义规则异常返回 | 代码搬运工 #107

Open chaojunma opened 2 years ago

chaojunma commented 2 years ago

http://www.51ufo.cn/%E5%BE%AE%E6%9C%8D%E5%8A%A1/2022/01/19/Sentinel%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A7%84%E5%88%99%E5%BC%82%E5%B8%B8%E8%BF%94%E5%9B%9E.html

默认情况下,发生限流、降级、授权拦截时,都会抛出异常到调用方。如果要自定义异常时的返回结果,需要实现BlockExceptionHandler接口: