Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio authored Mar 25, 2019
1 parent 33ff0c6 commit 6f64389
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ new OpenApiMiddleware({
}).install(app);
```

You should also register a custom error handler

```
// Register error handler!
app.use((err, req, res, next) => {
// format error
res.status(err.status).json({
errors: err.errors,
});
});
```

(see complete [example](#example))

## Example API Server
Expand Down

0 comments on commit 6f64389

Please sign in to comment.