Hi all,
I have some questions about the jersey client and its exceptions.
Why does the client only throw runtime exceptions (ClientHandlerException
and
UniformInterfaceException)?
Actually, I need to use the client and manage the most common HTTP responses
(400, 404, 500...).
For the moment, I catch the client exception and get the status code from
it. It means I need
to create a switch case to handle each case. For instance:
catch(ClientHandlerException e) {
switch(e.getResponse().getResponseStatus()):
case 400:
//some code
case 404:
//some code
....
}
Do you know if there's a better way to use the jersey client?
Thanks for your help.
Regards
--
Denis Ah-Kang