We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Example of how to customize errors in restify 5.x docs is incorrect.
Docs site for 5.x.
All
On the server API page (http://restify.com/docs/server-api/), example shows
server.on('InternalServer', function(req, res, err, callback) { err.body = 'Sorry, an error occurred!'; return callback(); });
But the returned value to client is still {}.
{}
We should be asking folks to implement a custom toJSON in their error listeners instead:
server.on('restifyError', function(req, res, err, callback) { err.toJSON = function customToJSON() { return 'i just want a string'; }; return callback(); });
More details on restify/errors#72.
Yes
The text was updated successfully, but these errors were encountered:
Fix: GH-1438, error reponse customization documentation incorrect
1febb3d
0bb4a7c
Fix: GH-1438, error reponse customization documentation incorrect (#1439
dd66088
)
No branches or pull requests
Bug Report
Example of how to customize errors in restify 5.x docs is incorrect.
Restify Version
Docs site for 5.x.
Node.js Version
All
Expected behaviour
On the server API page (http://restify.com/docs/server-api/), example shows
But the returned value to client is still
{}
.Actual behaviour
We should be asking folks to implement a custom toJSON in their error listeners instead:
Cause
More details on restify/errors#72.
Are you willing and able to fix this?
Yes
The text was updated successfully, but these errors were encountered: