elasticsearch
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -13,4 +13,5 @@ var Client = require('./lib/elasticsearch'); | ||
exports.Cluster = require('./lib/cluster'); | ||
exports.Index = require('./lib/index'); | ||
// For backwards compatibility | ||
exports.createClient = createClient; |
@@ -25,2 +25,3 @@ var http = require('http'); | ||
var buf = new Buffer(length), | ||
message = '', | ||
total = 0; | ||
@@ -42,4 +43,9 @@ chunks.forEach(function chunk_cb(chunk) { | ||
if (!((""+statusCode).match(/2\d\d/))) { | ||
cb(res_json); | ||
} else if (cb) { | ||
if (res_json.error) { | ||
message = res_json.error; | ||
} else if (res_json.exists === false) { | ||
message = 'Doc with id "'+res_json._id+'" and type "'+res_json._type+'" not found in index "'+res_json._index+'"'; | ||
} | ||
cb(new Error(message)); | ||
} else { | ||
cb(null, res_json); | ||
@@ -46,0 +52,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"main": "index.js", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"author": "Nick Campbell (http://github.com/ncb000gt)", | ||
@@ -23,7 +23,7 @@ "engines": { | ||
"devDependencies": { | ||
"nodeunit": "~0.7.4" | ||
"tap": "~0.4.1" | ||
}, | ||
"scripts": { | ||
"test": "nodeunit tests/suites" | ||
"test": "tap test/*.js" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21852
13
531