I designed a webservice to perform a task if request parameters are OK, or return 401 Unauthorized HTTP status code if request parameters are wrong or empty.
I\'m us
In my rest service I catch HttpStatusCodeException instead of Exception since HttpStatusCodeException has a method for getting the status code
HttpStatusCodeException
Exception
catch(HttpStatusCodeException e) { log.debug("Status Code", e.getStatusCode()); }