Feign 自定义 ErrorDecoder (捕获 Feign 服务端异常)
问题描述:Feign 客户端捕获不到服务端抛出的异常解决:微服务之间接口互相调用,Feign客户端需要捕获服务的抛出的异常,并且返回统一错误格式。@Configurationpublic class FeignErrorDecoder implements ErrorDecoder { @Override public Exception decode(String methodKey, Response response) { String ms.
原创
2021-04-10 14:00:46 ·
5216 阅读 ·
2 评论