node-restify icon indicating copy to clipboard operation
node-restify copied to clipboard

Preserve original error when there is no fallback formatter

Open CrabDude opened this issue 4 years ago • 0 comments

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.

CrabDude avatar Jan 28 '20 19:01 CrabDude