Error handling

    1. ctrl.get('/puppies', function (req, res) {
    2. try {
    3. // Exception is thrown here
    4. throw e;
    5. }
    6. }
    7. // The "error" method merely documents the meaning
    8. .error(400, 'Thrown if there are too many puppies.');