use of me.retrodaredevil.couchdbjava.exception.CouchDbUnauthorizedException in project solarthing by wildmountainfarms.
the class CouchDbAlterDatabase method delete.
@Override
public void delete(String documentId, UpdateToken updateToken) throws SolarThingDatabaseException {
RevisionUpdateToken revisionUpdateToken = CouchDbSolarThingDatabase.checkUpdateToken(updateToken);
String revision = revisionUpdateToken.getRevision();
try {
database.deleteDocument(documentId, revision);
} catch (CouchDbUnauthorizedException e) {
throw new UnauthorizedSolarThingDatabaseException(e);
} catch (CouchDbUpdateConflictException e) {
throw new UpdateConflictSolarThingDatabaseException("Update conflict on delete. Must not be latest revision. documentId: " + documentId + " revision: " + revision, e);
} catch (CouchDbNotFoundException e) {
throw new NotFoundSolarThingDatabaseException("(Not found) Could not delete documentId: " + documentId + " revision: " + revision, e);
} catch (CouchDbException e) {
throw new SolarThingDatabaseException("Could not delete documentId: " + documentId + " revision: " + revision, e);
}
}
Aggregations