Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

errors returned are gRPC errors #82

Closed
mcarmonaa opened this issue Sep 7, 2018 · 4 comments
Closed

errors returned are gRPC errors #82

mcarmonaa opened this issue Sep 7, 2018 · 4 comments
Assignees
Labels

Comments

@mcarmonaa
Copy link
Member

Errors returned by the client are all gRPC errors, so you can't distinguish for example if that error is an driver.ErrPartialParse error.

@dennwc dennwc self-assigned this Sep 7, 2018
@smola
Copy link
Member

smola commented Oct 5, 2018

@dennwc Any progress here? This limits our ability to decide a sane logging policy on gitbase.

@dennwc
Copy link
Member

dennwc commented Oct 5, 2018

First, please switch to v3 branch. I will update it to support all specific errors returned by parsing code.

@dennwc dennwc added the bug label Oct 5, 2018
@bzz
Copy link
Contributor

bzz commented Oct 9, 2018

@mcarmonaa indeed, that was the case with old protocol. I belive there are no plans right now for changing it in v2.

But did you try latest https://gopkg.in/bblfsh/client-go.v3 ?

The protocol has been changed (see the DesignDoc for summary of the changes, including error handling), so a new version follows gRPC guldelines on error handling and error field of the response is reserved only for parsing issues.

@smacker
Copy link
Contributor

smacker commented Oct 18, 2018

bblfsh/web use-case:

resp, lang, err := cli.NewParseRequest()...UAST()

it looks like the error can be one of:

  • network error
  • any kind of internal grpc error
  • driver error (can’t parse source code)
  • bblfsh error (can’t create tree from the response)
  • ???

We need to show driver error to the user but hide anything else with friendly message Unexpected error contacting babelfish server. Please, try again. (because it’s internal error and the user can’t fix it by providing different source code / language)

please correct me if my assumptions about errors are wrong or if there are any other errors that make sense to handle differently.

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

No branches or pull requests

5 participants