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

feat(common): Add error chaining support to http exception #9705

Merged
merged 2 commits into from
Jun 15, 2022

Conversation

vinnymac
Copy link
Contributor

@vinnymac vinnymac commented Jun 1, 2022

Adds the ability to configure the cause of an error when passing an error object to http exception.

I would love to see HTTP Exception change over time to be more flexible, such as having both a custom message and a cause, but for now this fits my needs.

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
    • Don't think this needs docs, since this is a side effect of passing an error, and not really a decision the user needs to make.

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

You can't set the cause of an error object.

Issue Number: N/A

What is the new behavior?

It is now possible to set the cause of an HTTP Exception based error.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Documentation

@coveralls
Copy link

coveralls commented Jun 1, 2022

Pull Request Test Coverage Report for Build 512b089e-b006-4e11-805a-1f5a3c4a7e57

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 94.107%

Totals Coverage Status
Change from base Build 6a42a282-8488-456e-9dd2-df532926a28e: 0.0%
Covered Lines: 5781
Relevant Lines: 6143

💛 - Coveralls

@kamilmysliwiec kamilmysliwiec changed the base branch from master to 9.0.0 June 15, 2022 09:48
@kamilmysliwiec kamilmysliwiec added this to the 9.0.0 milestone Jun 15, 2022
@kamilmysliwiec
Copy link
Member

lgtm

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

Successfully merging this pull request may close these issues.

4 participants