- URI uri = new URI(url);
- if (!uri.isAbsolute()) {
- throw new ServiceException("URI: " + url + " is not absolute", HttpStatus.CONFLICT);
+ try {
+ URI uri = new URI(url);
+ if (!uri.isAbsolute()) {
+ throw new ServiceException("URI: " + url + " is not absolute", HttpStatus.BAD_REQUEST);
+ }
+ } catch (URISyntaxException e) {
+ throw new ServiceException(e.getMessage(), HttpStatus.BAD_REQUEST);