Skip to content

fix: respect exposed error messages#153

Open
vibhor-aggr wants to merge 1 commit into
pillarjs:masterfrom
vibhor-aggr:fix/respect-exposed-errors
Open

fix: respect exposed error messages#153
vibhor-aggr wants to merge 1 commit into
pillarjs:masterfrom
vibhor-aggr:fix/respect-exposed-errors

Conversation

@vibhor-aggr

Copy link
Copy Markdown

Uses err.message for production responses when an error explicitly sets err.expose.

This keeps the existing behavior for non-production responses, where stacks are shown, and keeps production 5xx/unexposed errors hidden behind the status message. It gives callers using http-errors or similar libraries the documented way to expose safe 4xx messages.

Refs #24.

Verification:

  • npm test (110 passing, 4 pending)
  • npm run lint
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant