jasonpet commented on a change in pull request #155: #112 Adding feature to 
insert document when overwrite and putIfAbsent?
URL: 
https://github.com/apache/incubator-openwhisk-package-cloudant/pull/155#discussion_r166390965
 
 

 ##########
 File path: actions/database-actions/write-document.js
 ##########
 @@ -62,8 +63,13 @@ function insertOrUpdate(cloudantDb, overwrite, doc) {
                                reject(err);
                             });
                     } else {
-                        console.error('error', error);
-                        reject(error);
+                        if(error.statusCode === 404) {
+                            // If document not found, insert it
+                            return insert(cloudantDb, doc);
 
 Review comment:
   the promise that contains the cloudant "get" is never resolved for this path

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to