Skip to content

Commit

Permalink
(#41) - return correct error code in changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson committed May 28, 2014
1 parent 0d59572 commit 040fb76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
};
}
Expand Down

0 comments on commit 040fb76

Please sign in to comment.