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 · 2 comments

Comments

Projects
None yet
2 participants
@patrickhousley
Copy link
Contributor

patrickhousley commented Jul 4, 2018

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

This comment has been minimized.

Copy link
Member

kamilmysliwiec commented Jul 4, 2018

Word. I'll fix that soon

@kamilmysliwiec

This comment has been minimized.

Copy link
Member

kamilmysliwiec commented Jul 5, 2018

Fixed in 5.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.