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

fix(microservices): handle creating error header from typical object #9101

Closed
wants to merge 3 commits into from

Conversation

JoshVee
Copy link

@JoshVee JoshVee commented Feb 4, 2022

PR Checklist

Please check if your PR fulfills the following requirements:

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?

When an error is thrown by a Kafka message handler, the ServerKafka will attempt to add the error message to a header named kafka_nest-err.

This logic assumes the error can be converted directly to a Buffer via Buffer.from(err). This does not support Error objects (or typical Nest RpcException).

Issue Number: N/A

What is the new behavior?

It now checks for a message property before attempting to convert the error value to a Buffer.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@coveralls
Copy link

Pull Request Test Coverage Report for Build 31edb5fe-ec04-41b5-9acf-704e4d3dbabc

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 53 unchanged lines in 13 files lost coverage.
  • Overall coverage decreased (-0.05%) to 94.08%

Files with Coverage Reduction New Missed Lines %
packages/common/utils/is-uuid.ts 1 83.33%
packages/core/exceptions/exceptions-handler.ts 1 93.33%
packages/core/injector/module-token-factory.ts 1 94.29%
packages/core/router/sse-stream.ts 1 92.59%
packages/core/services/reflector.service.ts 1 89.29%
packages/common/file-stream/streamable-file.ts 2 76.19%
packages/core/helpers/messages.ts 3 77.27%
packages/core/router/route-path-factory.ts 4 90.59%
packages/microservices/server/server.ts 4 92.16%
packages/microservices/client/client-nats.ts 5 87.41%
Totals Coverage Status
Change from base Build 0d5c684c-d10b-41c2-9ae2-bc7e388dc612: -0.05%
Covered Lines: 5658
Relevant Lines: 6014

💛 - Coveralls

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.

None yet

4 participants