diff --git a/api.js b/api.js index c332561..aa65e26 100644 --- a/api.js +++ b/api.js @@ -126,7 +126,7 @@ function paginate(key, dataFn) { return callback(err, data); if (!data[key].length) - return callback(errors.BadGateway('Unpageable data returned from upstream'), data); + return callback(new errors.BadGateway('Unpageable data returned from upstream'), data); var pages = Math.ceil(data[key].length / pageSize);