从feignException设置错误500的真正原因

时间:2018-07-10 12:05:59

标签: spring-cloud-feign feign

在我的微服务上,我使用spring boot feign来请求RestAPI。此内容返回一个错误404:

{
  "timestamp":"2018-07-10T11:47:47.011+0000",
  "status":404,
  "error":"Not Found",
  "message":"Device not found",
  "path":"/object/fakefake-0000-0000-1111-d7bdce4c6749/measures/first"}

此调用没有后退,因此引发了runtimeException,并且出现500错误。answare的内容为:

{
  "timestamp": "2018-07-10T11:47:47.205+0000",
  "status": 500,
  "error": "Internal Server Error",
  "message": "IDeviceClient#getFirstMeasure(String,String) failed and no fallback available.",
  "path": "/patients/23/devices/socks/steps"
}

有没有一种方法可以使消息替换为真正的原因(来自伪装客户端上的404错误)?

0 个答案:

没有答案