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

    r525 r527  
    1717        return couch.get(url,{query:query})
    1818        .handle({
     19            '-1': _.identity,
    1920            200: util.handleRowDocs,
    2021            default: util.handleUnknownResponse
     
    2627        return couch.get(url,{query:query})
    2728        .handle({
     29            '-1': _.identity,
    2830            200: util.handleRowDocs,
    2931            default: util.handleUnknownResponse
     
    3537        return couch.get(url,{query:query})
    3638        .handle({
     39            '-1': _.identity,
    3740            200: util.handleRowDictOfValues,
    3841            default: util.handleUnknownResponse
     
    4447        return couch.get(url,{query:query})
    4548        .handle({
     49            '-1': _.identity,
    4650            200: util.handleRowDocs,
    4751            default: util.handleUnknownResponse
     
    5660        return couch.get(url,{query:query})
    5761        .handle({
     62            '-1': _.identity,
    5863            200: util.handleRowDocs,
    5964            default: util.handleUnknownResponse
     
    6772        return couch.get(url)
    6873        .handle({
     74            '-1': _.identity,
    6975            200: util.handleRowDictOfValues,
    7076            default: util.handleUnknownResponse
     
    9399                hr = getQuestions(sub);
    94100            }
    95             hr.handle(res.send.bind(res));
     101            hr.handle({'-1': util.handleException})
     102              .handle(res.send.bind(res));
    96103        });
    97104    app.post('/',
     
    122129                });
    123130            }
    124             hr.handle(res.send.bind(res));
     131            hr.handle({'-1': util.handleException})
     132              .handle(res.send.bind(res));
    125133        });
    126134    app.get('/:id',
     
    160168                });
    161169            }
    162             hr.handle(res.send.bind(res));
     170            hr.handle({'-1': util.handleException})
     171              .handle(res.send.bind(res));
    163172        });
    164173    app.delete('/:id',
Note: See TracChangeset for help on using the changeset viewer.