grpc icon indicating copy to clipboard operation
grpc copied to clipboard

How to do error handling?

Open munjalpatel opened this issue 5 years ago • 6 comments

First of all, this is simply great! Awesome work!!

I am trying to figure out how to properly return errors on exceptions. Any suggestions?

munjalpatel avatar Jul 24 '20 16:07 munjalpatel

Good point. I don't think there's anything in here yet for it for returning any response code other than 0 (OK). I think this is the reason the Ruby implementation requires you to accept the call object in your method, so you can change the status.

I think it'd be a great idea to at least rescue exceptions and return an internal error if this shard doesn't already do that — it's been a while since I looked at that part of the code. 🙂

jgaskins avatar Jul 24 '20 22:07 jgaskins

Yeah, I think two things are missing:

  1. Error / Exception Management
  2. Authentication / Metadata support

munjalpatel avatar Aug 01 '20 15:08 munjalpatel

Those are two pretty big issues. Are there any plans on implementing them?

bendangelo avatar Jun 12 '24 01:06 bendangelo

I'm open to suggestions

jgaskins avatar Jun 12 '24 03:06 jgaskins

I've opened a PR to add status codes. For auth I'm not sure where to start. https://github.com/jgaskins/grpc/pull/13

bendangelo avatar Jun 12 '24 05:06 bendangelo

Also I've noticed, the standard "list" command to see available services is not available. This would be a nice addition.

bendangelo avatar Jun 12 '24 05:06 bendangelo