We are using Spring's RestTemplate and I would like to learn if there's any way to pass a custom exception to the client ... more than just error codes.
I would like to see if I can add checked exceptions from the service layer all the way up to the web controller layer.
Here's how we call a rest endpoint now:
return getRestTemplate().exchange(createUrl, HttpMethod.POST, new HttpEntity(request, getRequestHeaders()),
OurCustomResponse.class).getBody();
Maybe a dumb question? Thanks all.
Aucun commentaire:
Enregistrer un commentaire