Skip to content

Instantly share code, notes, and snippets.

@atuttle

atuttle/err.txt Secret

Created March 9, 2013 04:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atuttle/a57be3663d2baaed24a3 to your computer and use it in GitHub Desktop.
Save atuttle/a57be3663d2baaed24a3 to your computer and use it in GitHub Desktop.
{ [Error: Request body must be a JSON object]
name: 'Error',
scope: 'couch',
status_code: 400,
'status-code': 400,
request:
{ method: 'POST',
headers:
{ 'content-type': 'application/json',
accept: 'application/json' },
uri: 'https://user:pass@snitchio.cloudant.com/poc/_bulk_docs',
body: '[{"_id":"2e77002c-9d73-49b1-b925-c8c8b1ec2a5b","_rev":"1-e87a526f725b920c988aada7364ff408","_deleted":true}]',
timeout: 30000,
callback: [Function] },
headers:
{ 'x-couch-request-id': '30b6e5a6',
date: 'Sat, 09 Mar 2013 04:44:39 GMT',
'content-type': 'application/json',
'cache-control': 'must-revalidate',
'status-code': 400,
uri: 'https://user:pass@snitchio.cloudant.com/poc/_bulk_docs' },
errid: 'non_200',
error: 'bad_request',
reason: 'Request body must be a JSON object',
description: 'Request body must be a JSON object',
stacktrace:
[ 'Error: Request body must be a JSON object',
' at Request._callback (/Users/adam/DEV/nano/nano.js:318:39)',
' at Request.init.self.callback (/Users/adam/DEV/nano/node_modules/request/main.js:122:22)',
' at Request.EventEmitter.emit (events.js:99:17)',
' at Request.<anonymous> (/Users/adam/DEV/nano/node_modules/request/main.js:661:16)',
' at Request.EventEmitter.emit (events.js:126:20)',
' at IncomingMessage.Request.start.self.req.self.httpModule.request.buffer (/Users/adam/DEV/nano/node_modules/request/main.js:623:14)',
' at IncomingMessage.EventEmitter.emit (events.js:126:20)',
' at IncomingMessage._emitEnd (http.js:366:10)',
' at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)' ] }
var set = [];
_.each(exceptions.rows, function(el, ix, value){
set.push({ "_id": el.id, "_rev": el.value._rev, "_deleted": true });
});
db.bulk(set, function(err, res){
if (err){
return callback(false);
}
callback(null, set.length);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment