node-restify
node-restify copied to clipboard
Preserve original error when there is no fallback formatter
Pre-Submission Checklist
- [x] Ran the linter and tests via
make prepush
- [x] Included comprehensive and convincing tests for changes
Issues
Summarize the issues that discussed these changes There is an edge case where
strictFormatters=true
,content-type
is set without a supported formatter, and an error is passed. Right now the error will fall through to a raw serialization (res.write
), which fails to serialize the error object.
Changes
What does this PR do?
Ensures the original error is preserved with an InternalServerError
, instead of falling through to res.write
.