Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: emit restifyError event even for router errors #1420

Merged
merged 2 commits into from Aug 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 0 additions & 15 deletions docs/api/server.md
Expand Up @@ -266,21 +266,6 @@ server.on('restifyError', function(req, res, err, callback) {
});
```

### FormatterError

This event is fired when an async formatter returns an error as a result of
calling `res.send()`. Unlike other error events, if you listen this event, it
is expected that you flush a response. Once a formatter has returned an error,
restify cannot make any assumptions about how to format the content. It is up
to you to figure out how to best do that.

```js
server.on('FormatterError', function(req, res, route, err) {
// err is a formatter error - can't sa
res.end('unsafe to call res.send, in case formatter blows up again!');
});
```


## after

Expand Down
2 changes: 0 additions & 2 deletions lib/response.js
Expand Up @@ -16,8 +16,6 @@ var utils = require('./utils');
///--- Globals

var InternalServerError = errors.InternalServerError;
// make custom error constructors
errors.makeConstructor('FormatterError');

var Response = http.ServerResponse;

Expand Down