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/surveys.js

    r525 r527  
    2323            couch.get(url)
    2424            .handle({
     25                '-1': _.identity,
    2526                200: function(result) {
    2627                    return _.map(result.rows, function(item) {
     
    3031                default: util.handleUnknownResponse
    3132            })
     33            .handle({'-1': util.handleException})
    3234            .handle(res.send.bind(res));
    3335        });
     
    4547                hr = util.postDocument('Survey',doc);
    4648            }
    47             hr.handle(res.send.bind(res));
     49            hr.handle({'-1': util.handleException})
     50              .handle(res.send.bind(res));
    4851        });
    4952    app.get('/:id',
     
    6669                util.putDocument(id,rev,'Survey',doc)
    6770                .handle({
     71                    '-1': function(result) {
     72                        util.handleException(result)
     73                        .handle(res.send.bind(res));
     74                    },
    6875                    201: function(doc) {
    6976                        res.set({
Note: See TracChangeset for help on using the changeset viewer.