Package org.openrdf.http.protocol.error

Examples of org.openrdf.http.protocol.error.ErrorInfo


      logger.debug("Transaction processed ");

      return new ModelAndView(EmptySuccessView.getInstance());
    }
    catch (SAXParseException e) {
      ErrorInfo errInfo = new ErrorInfo(ErrorType.MALFORMED_DATA, e.getMessage());
      throw new ClientHTTPException(SC_BAD_REQUEST, errInfo.toString());
    }
    catch (SAXException e) {
      throw new ServerHTTPException("Failed to parse transaction data: " + e.getMessage(), e);
    }
    catch (IOException e) {
View Full Code Here


    catch (UnsupportedRDFormatException e) {
      throw new ClientHTTPException(SC_UNSUPPORTED_MEDIA_TYPE, "No RDF parser available for format "
          + rdfFormat.getName());
    }
    catch (RDFParseException e) {
      ErrorInfo errInfo = new ErrorInfo(ErrorType.MALFORMED_DATA, e.getMessage());
      throw new ClientHTTPException(SC_BAD_REQUEST, errInfo.toString());
    }
    catch (IOException e) {
      throw new ServerHTTPException("Failed to read data: " + e.getMessage(), e);
    }
    catch (RepositoryException e) {
View Full Code Here

          result.setBinding(bindingName, bindingValue);
        }
      }
    }
    catch (UnsupportedQueryLanguageException e) {
      ErrorInfo errInfo = new ErrorInfo(ErrorType.UNSUPPORTED_QUERY_LANGUAGE, queryLn.getName());
      throw new ClientHTTPException(SC_BAD_REQUEST, errInfo.toString());
    }
    catch (MalformedQueryException e) {
      ErrorInfo errInfo = new ErrorInfo(ErrorType.MALFORMED_QUERY, e.getMessage());
      throw new ClientHTTPException(SC_BAD_REQUEST, errInfo.toString());
    }
    catch (RepositoryException e) {
      logger.error("Repository error", e);
      response.sendError(SC_INTERNAL_SERVER_ERROR);
    }
View Full Code Here

      }
      else if (httpCode == HttpURLConnection.HTTP_UNAUTHORIZED) {
        throw new UnauthorizedException();
      }
      else {
        ErrorInfo errInfo = getErrorInfo(method);
        throw new RepositoryException("Failed to get server protocol: " + errInfo);
      }
    }
    finally {
      method.releaseConnection();
View Full Code Here

      if (httpCode == HttpURLConnection.HTTP_UNAUTHORIZED) {
        throw new UnauthorizedException();
      }
      else if (!HttpClientUtil.is2xx(httpCode)) {
        ErrorInfo errInfo = getErrorInfo(method);
        throw new RepositoryException("Transaction failed: " + errInfo + " (" + httpCode + ")");
      }
    }
    finally {
      releaseConnection(method);
View Full Code Here

      }
      else if (httpCode == HttpURLConnection.HTTP_UNSUPPORTED_TYPE) {
        throw new UnsupportedRDFormatException(method.getResponseBodyAsString());
      }
      else if (!HttpClientUtil.is2xx(httpCode)) {
        ErrorInfo errInfo = ErrorInfo.parse(method.getResponseBodyAsString());

        if (errInfo.getErrorType() == ErrorType.MALFORMED_DATA) {
          throw new RDFParseException(errInfo.getErrorMessage());
        }
        else if (errInfo.getErrorType() == ErrorType.UNSUPPORTED_FILE_FORMAT) {
          throw new UnsupportedRDFormatException(errInfo.getErrorMessage());
        }
        else {
          throw new RepositoryException("Failed to upload data: " + errInfo);
        }
      }
View Full Code Here

      }
      else if (httpCode == HttpURLConnection.HTTP_UNAUTHORIZED) {
        throw new UnauthorizedException();
      }
      else {
        ErrorInfo errInfo = getErrorInfo(method);
        throw new RepositoryException("Failed to get namespace: " + errInfo + " (" + httpCode + ")");
      }
    }
    finally {
      releaseConnection(method);
View Full Code Here

      if (httpCode == HttpURLConnection.HTTP_UNAUTHORIZED) {
        throw new UnauthorizedException();
      }
      else if (!HttpClientUtil.is2xx(httpCode)) {
        ErrorInfo errInfo = getErrorInfo(method);
        throw new RepositoryException("Failed to set namespace: " + errInfo + " (" + httpCode + ")");
      }
    }
    finally {
      releaseConnection(method);
View Full Code Here

      if (httpCode == HttpURLConnection.HTTP_UNAUTHORIZED) {
        throw new UnauthorizedException();
      }
      else if (!HttpClientUtil.is2xx(httpCode)) {
        ErrorInfo errInfo = getErrorInfo(method);
        throw new RepositoryException("Failed to remove namespace: " + errInfo + " (" + httpCode + ")");
      }
    }
    finally {
      releaseConnection(method);
View Full Code Here

      if (httpCode == HttpURLConnection.HTTP_UNAUTHORIZED) {
        throw new UnauthorizedException();
      }
      else if (!HttpClientUtil.is2xx(httpCode)) {
        ErrorInfo errInfo = getErrorInfo(method);
        throw new RepositoryException("Failed to clear namespaces: " + errInfo + " (" + httpCode + ")");
      }
    }
    finally {
      releaseConnection(method);
View Full Code Here

TOP

Related Classes of org.openrdf.http.protocol.error.ErrorInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.