使用spring cloud feign调用我的服务,当服务返回401异常时,respose.body()为null。
当我抛出异常时,throw new BadRequestException(400, “this http code is 400”);我可以this http code is 400通过response.body(). 但是当我抛出异常时throw new BadRequestException(401, “this http code is 401”);,它response.body()是空的。这个回应是feign.Response。
为什么当 http 代码为 401 时我无法收到此错误消息?
希望您的帮助!非常感谢!