From 040fb76ea18e970bf691b06a9f7174cb3f70ea2c Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sat, 24 May 2014 12:20:14 -0700 Subject: [PATCH] (#41) - return correct error code in changes --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index f6762f47..6e6a6324 100644 --- a/index.js +++ b/index.js @@ -276,7 +276,7 @@ app.get('/:db/_changes', function (req, res, next) { req.query.query_params = JSON.parse(JSON.stringify(req.query)); function longpoll(err, data) { - if (err) return res.send(409, err); + if (err) return res.send(err.status, err); if (data.results && data.results.length) { data.last_seq = Math.max.apply(Math, data.results.map(function (r) { return r.seq; @@ -298,7 +298,7 @@ app.get('/:db/_changes', function (req, res, next) { req.query.complete = longpoll; } else { req.query.complete = function (err, response) { - if (err) return res.send(409, err); + if (err) return res.send(err.status, err); res.send(200, response); }; }