code: public Document loadDocument(String location) throws Exception
  	{
          String spec = retrieveSpecification(URI.create(URIUtil.raw(location)));
          LOGGER.trace("Page retrieved from the repository for location '{}'\n{}", location,spec);
          // check if there is an error in the page
          org.jsoup.nodes.Document jsoupDoc = Jsoup.parse(spec);
          jsoupDoc.outputSettings().prettyPrint(false);
          Elements select = jsoupDoc.select("#conf_actionError_Msg");
          for (Element element : select) {
              if (element.hasText()) {
                  if ( StringUtils.equals(element.text(), PAGE_NOT_FOUND)) {
                      throw new DocumentNotFoundException(location);
                  } else if (StringUtils.equals(element.text(), PARAMETERS_MISSING)){
                      throw new RepositoryException(PARAMETERS_MISSING);
                  } else if (StringUtils.equals(element.text(), SESSION_INVALID)){
                      throw new RepositoryException(SESSION_INVALID);
                  } else if (StringUtils.equals(element.text(), INSUFFICIENT_PRIVILEGES)){
                      throw new RepositoryException(INSUFFICIENT_PRIVILEGES);
                  }
              }
          }
          select = jsoupDoc.select("#conf_actionWarn_Msg");
          for (Element element : select) {
              if (element.hasText()) {
                  if ( StringUtils.equals(element.text(), THIS_SPECIFICATION_WAS_NEVER_SET_AS_IMPLEMENTED)) {
                      throw new DocumentNeverImplementedException(format("%s - %s", location, THIS_SPECIFICATION_WAS_NEVER_SET_AS_IMPLEMENTED));
                  }
              }
          }
  
          return loadHtmlDocument( jsoupDoc );
  	}
docs: {@inheritDoc}