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

    r525 r527  
    3030                });
    3131            }
    32             hr.handle(res.send.bind(res));
     32            hr.handle({'-1': util.handleException})
     33              .handle(res.send.bind(res));
    3334        });
    3435    app.get('/:id',
     
    5354                hr = util.putDocument(id,rev,'SurveyRun',doc);
    5455            }
    55             hr.handle(res.send.bind(res));
     56            hr.handle({'-1': util.handleException})
     57              .handle(res.send.bind(res));
    5658        });
    5759    app.delete('/:id',
     
    7072                    }
    7173                }
    72             }).handle(res.send.bind(res));
     74            })
     75            .handle({'-1': util.handleException})
     76            .handle(res.send.bind(res));
    7377        });
    7478    app.get('/:id/responses',
     
    7781            var id = req.params.id;
    7882            responses.getResponsesBySurveyRunId(id)
     83            .handle({'-1': util.handleException})
    7984            .handle(res.send.bind(res));
    8085        });
     
    8590            responses.getResponsesBySurveyRunId(id)
    8691            .handle({
     92                '-1': function(result) {
     93                    util.handleException(result)
     94                    .handle(res.send.bind(res));
     95                },
    8796                200: function(responses) {
    8897                    var answers = _.map(responses,function(response){
Note: See TracChangeset for help on using the changeset viewer.