Package com.couchace.core.api.http

Examples of com.couchace.core.api.http.CouchHttpException


        }
        if (response.isOk()) {
            String content = response.getStringContent();
            if (!content.contains("couchdb")) {
                String msg = String.format("The server at " + httpClient.getBaseUrl() + " is not a couch database.");
                throw new CouchHttpException(CouchHttpStatus.CONFLICT, msg);
            }
        } else {
            throw new CouchHttpException(response.getHttpStatus(), response.getErrorReason());
        }

    }
View Full Code Here


    return hasPrev;
  }

  private static void validate(GetEntityResponse response) {
    if (response.isOk() == false) {
      throw new CouchHttpException(response.getStatusCode(), "Unexpected response while executing couch query.");
    }
  }
View Full Code Here

        }
        if (response.isOk()) {
            String content = response.getStringContent();
            if (!content.contains("couchdb")) {
                String msg = String.format("The server at " + httpClient.getBaseUrl() + " is not a couch database.");
                throw new CouchHttpException(CouchStatusCode.CONFLICT, msg);
            }
        } else {
            throw new CouchHttpException(response.getStatusCode(), response.getErrorReason());
        }

    }
View Full Code Here

TOP

Related Classes of com.couchace.core.api.http.CouchHttpException

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.