0

When using spring cloud feign, I want to catch exceptions thrown by the service, but all I can get:

 nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of ...
Sandeep Kumar
  • 2,397
  • 5
  • 30
  • 37
  • 2
    Could you share some code snippet and full stack trace? – Sandeep Kumar Dec 13 '19 at 11:03
  • Thank youI think it's because feign calls the service over HTTP, and when the service throws an exception directly, the caller can't handle that information while deserializing it.We used @Exceptionhandler to wrap the exception into an APIResult object, and each time the caller had to retrieve the returned data through the APIResult, which was cumbersome, so I wanted the caller to catch the exception thrown by the service provider directly, and normally receive the returned data directly. – goolnen Dec 30 '19 at 06:01

0 Answers0