Ignore:
Timestamp:
03/23/14 17:26:12 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Dropped request module for a simple one we wrote ourselves using the native Node modules. Hopefully this one will not suffer from the problem that sometimes empty bodies are returned even when the statuscode and content-length of the request are ok & present.
  • Handle exceptions better in HTTPResult chain, they were hoisted in unknown responses before. Should we not include them in default processing, because they are special?
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/server/api/topics.js

    r525 r527  
    1414        return couch.get(url,{query:{reduce:true,group:true}})
    1515        .handle({
     16            '-1': _.identity,
    1617            200: function(result) {
    1718                return _.map(result.rows, function(item) { return {name:item.key, count:item.value}; });
     
    2425        return couch.get(url,{query:{reduce:true,group:true,group_level:2,startkey:[category],endkey:[category,{}]}})
    2526        .handle({
     27            '-1': _.identity,
    2628            200: function(result) {
    2729                return _.map(result.rows, function(item) { return { name:item.key[1], count:item.value }; });
     
    4143                hr = getTopics(sub);
    4244            }
    43             hr.handle(res.send.bind(res));
     45            hr.handle({'-1': util.handleException})
     46              .handle(res.send.bind(res));
    4447        });
    4548
Note: See TracChangeset for help on using the changeset viewer.