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

Don't swallow grpc load errors #844

Closed
patrickhousley opened this issue Jul 4, 2018 · 3 comments
Closed

Don't swallow grpc load errors #844

patrickhousley opened this issue Jul 4, 2018 · 3 comments

Comments

@patrickhousley
Copy link
Contributor

I'm submitting a...


[ ] Regression 
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

Attempting to load an invalid proto file with the gRPC microservice client and server results in a generic error: Error: The invalid .proto definition (file not found).

Expected behavior

If gRPC load method throws an error, wrap it with the NestJS InvalidProtoDefinitionException but maintain the message from the gRPC exception. These exceptions typically provide a lot more information such as the service or message that is invalid.

Minimal reproduction of the problem with instructions

Use sample/04-grps and change the src/hero/hero.proto file to the below:

syntax = "proto3";

package hero;

service HeroService {
  rpc FindOne (HeroBy) returns (Hero) {}
}

message HeroById {
  int32 id = 1;
}

message Hero {
  int32 id = 1;
  string name = 2;
}

Notice I have declared a service that takes in a message that is not defined.

What is the motivation / use case for changing the behavior?

Better error messaging to developers while developing gRPC microservices.

Environment


Nest version: 5.0.1

 
For Tooling issues:
- Node version: 8.11.3  
- Platform: Windows 10 Pro 

Others:

@kamilmysliwiec
Copy link
Member

Word. I'll fix that soon

@kamilmysliwiec
Copy link
Member

Fixed in 5.1.0

@lock
Copy link

lock bot commented Sep 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants