shrini1000
shrini1000

Reputation: 7226

Spring REST throwing Exceptions to clients

I have a Spring MVC based REST service. My controllers have @ExceptionHandler annotated methods for catching exceptions. I need to access the actual exception object and re-throw it to the REST client (which is Spring RestTemplate based) so the client can access the exception and its contents. How do I do it?

Upvotes: 1

Views: 369

Answers (1)

ayengin
ayengin

Reputation: 1596

I had a similar problem ,and i pass current Response Object along with Exception and write exception content to response .I know this is not an perfect solution but i didnt find any other way supported by spring.

Upvotes: 1

Related Questions