Skip to content

Commit b0363c9

Browse files
committed
Merge branch 'develop'
* develop: fix error leak on list_db 403
2 parents 5e7cd92 + 14153cd commit b0363c9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

77-cloudant-cf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ module.exports = function(RED) {
140140
function createDatabase(cloudant, node) {
141141
cloudant.db.list(function(err, all_dbs) {
142142
if (err) {
143-
if (err.error !== 'forbidden') {
144-
// if err.error is 'forbidden' then we are using an api
145-
// key, so we can assume the database already exists
143+
if (err.status_code === 403) {
144+
// if err.status_code is 403 then we are probably using
145+
// an api key, so we can assume the database already exists
146146
return;
147147
}
148148
node.error("Failed to list databases: " + err.description, err);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name" : "node-red-node-cf-cloudant",
3-
"version" : "0.2.13",
3+
"version" : "0.2.14",
44
"description" : "A Node-RED node to access a Cloudant database on Bluemix",
55
"dependencies" : {
66
"cfenv" : "1.0.0",

0 commit comments

Comments
 (0)