code: private void handleWebException(WebApplicationException  exception)  {
  
         Response response = exception.getResponse();
         if (response == null) {
             throw new AuxiliaryStorageException("Mapping exception error: response is null");
         }
  
         int responseStatus = response.getStatus();
  
         if (Status.BAD_REQUEST.getStatusCode() == responseStatus) {
             throw new IllegalParameterException("Bad request server error");
         } else if (Status.NOT_FOUND.getStatusCode() == responseStatus) {
             throw new ObjectNotFoundException("Object not found in auxiliary storage");
         } else if (Status.CONFLICT.getStatusCode() == responseStatus) {
             throw new ObjectAlreadyExistsException("Object already exists in auxiliary storage");
         } else if (Status.INTERNAL_SERVER_ERROR.getStatusCode() == responseStatus) {
             throw new AuxiliaryStorageException("Internal server error");
         } else {
             throw new AuxiliaryStorageException("Unknown server error");
         }
     }
docs: This method is supposed to be used as exception mapper
  from <code>WebApplicationException</code>, sent in REST response,
  to <code>AuxiliaryStorageException</code>.
  
  @param exception Exception to convert from.