.map(new Func1<UpsertDesignDocumentResponse, DesignDocument>() {
@Override
public DesignDocument call(UpsertDesignDocumentResponse response) {
if (!response.status().isSuccess()) {
String msg = response.content().toString(CharsetUtil.UTF_8);
throw new DesignDocumentException("Could not store DesignDocument: " + msg);
}
return designDocument;
}
});
}