Skip to content
This repository has been archived by the owner on Nov 24, 2018. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:corpix/express-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
corpix committed Mar 4, 2012
2 parents 2fe8145 + 60c6ee3 commit 9675086
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ Provides easy access to common http errors for express e.g.
You need create `views/errors` directory and add 401,403,404 error views.

```javascript
var errors = require('express-errors');

errors.bind(app, { layout: false });

app.get('/400', function(req, res, next){
next(errors.BadRequest); // You will get "bad request" error
});

app.get('/500', function(req, res, next){
next(new Error('Something went wrong :(')); // You will get "Internal server error" error
})
});

var errors = require('express-errors');

errors.bind(app, { layout: false }); // Important! Call it after all routes ready
```

#### Options
Expand Down

0 comments on commit 9675086

Please sign in to comment.