}
else if (httpCode == HttpURLConnection.HTTP_UNAUTHORIZED) {
throw new UnauthorizedException();
}
else {
ErrorInfo errInfo = getErrorInfo(method);
// Throw appropriate exception
if (errInfo.getErrorType() == ErrorType.MALFORMED_QUERY) {
throw new MalformedQueryException(errInfo.getErrorMessage());
}
else if (errInfo.getErrorType() == ErrorType.UNSUPPORTED_QUERY_LANGUAGE) {
throw new UnsupportedQueryLanguageException(errInfo.getErrorMessage());
}
else {
throw new RepositoryException(errInfo.toString());
}
}
}