You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ma...@apache.org on 2018/04/03 10:53:08 UTC

[incubator-openwhisk] branch master updated: Make rev in BulkEntityResult optional. (#3512)

This is an automated email from the ASF dual-hosted git repository.

markusthoemmes pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new af08fd3  Make rev in BulkEntityResult optional. (#3512)
af08fd3 is described below

commit af08fd3ab9bf07e6a8f5716467f57bab909410c6
Author: jiangpch <ji...@navercorp.com>
AuthorDate: Tue Apr 3 18:53:04 2018 +0800

    Make rev in BulkEntityResult optional. (#3512)
    
    If the returned value contains an error (for example a "conflict"), there won't be a revision, hence the json deserialization fails.
    
    Fixes #3511
---
 common/scala/src/main/scala/whisk/core/entity/DocInfo.scala | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/common/scala/src/main/scala/whisk/core/entity/DocInfo.scala b/common/scala/src/main/scala/whisk/core/entity/DocInfo.scala
index fa107a6..68b89c5 100644
--- a/common/scala/src/main/scala/whisk/core/entity/DocInfo.scala
+++ b/common/scala/src/main/scala/whisk/core/entity/DocInfo.scala
@@ -97,11 +97,8 @@ protected[core] case class DocInfo protected[entity] (id: DocId, rev: DocRevisio
  * @param error the error, that occured on trying to put this document into CouchDB
  * @param reason the error message that correspands to the error
  */
-case class BulkEntityResult(id: String,
-                            rev: DocRevision = DocRevision.empty,
-                            error: Option[String],
-                            reason: Option[String]) {
-  def toDocInfo = DocInfo(DocId(id), rev)
+case class BulkEntityResult(id: String, rev: Option[DocRevision], error: Option[String], reason: Option[String]) {
+  def toDocInfo = DocInfo(DocId(id), rev.getOrElse(DocRevision.empty))
 }
 
 protected[core] object DocId extends ArgNormalizer[DocId] {

-- 
To stop receiving notification emails like this one, please contact
markusthoemmes@apache.org.