Package com.couchace.core.api

Examples of com.couchace.core.api.CouchException


                String revision = document.getDocumentRevision();
                WriteResponse deleteResponse = new DeleteDocumentRequest(this, DeleteDocumentRequest.Type.DOCUMENT, id, revision)
                        .execute();
                if (deleteResponse.isError()) {
                    String msg = String.format("Error deleting document %s rev(%s) - %s", id, revision, deleteResponse.getErrorReason());
                    throw new CouchException(deleteResponse.getStatusCode(), msg);
                }
            }
        }
        couchHttpResponse = CouchHttpResponse.builder(CouchMethodType.DELETE, httpClient.uri(path), CouchStatusCode.OK).build();
        return new WriteResponse(couchHttpResponse);
View Full Code Here


                if (value != null) {
                    couchHttpResponse = writeAttachment(attachmentMeta, couchHttpResponse.getDocumentId(), couchHttpResponse.getDocumentRevision(), value);
                }
            } catch (CouchException e) {
                log.error(e);
                throw new CouchException(CouchStatusCode.INTERNAL_SERVER_ERROR, "Exception saving attachment: " + e.getMessage(), e);
            }
        }
        return couchHttpResponse;
    }
View Full Code Here

        if (couchHttpResponse.isError()) {
            CouchErrorContent errorContent = CouchErrorContent.parseJson(couchHttpResponse.getStringContent());
            String msg = String.format("Store of document successful but failed in storage of attachment with status: %s and error content: %s",
                    couchHttpResponse.getStatusCode().getReason(),
                    errorContent.toString());
            throw new CouchException(couchHttpResponse.getStatusCode(), msg);
        }

        return couchHttpResponse;

    }
View Full Code Here

TOP

Related Classes of com.couchace.core.api.CouchException

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.