-
Notifications
You must be signed in to change notification settings - Fork 54
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
Error reporting on ParseUAST to avoid panic: runtime error
#44
Comments
I think there are two questions here.
|
@juanjux agree on both points, sorry for confusion. Updated the description above |
Documentation fixed here: bblfsh/documentation#53 Note that the Babelfish protocol defines its own error handling ( |
Sounds good. |
Right now
resp, err := client.ParseUAST(context.TODO(), req)
may fail with error beeing NOTnil
but actual parsing has failed and there areresp.Errors
andresp.status
isfatal
.which is absolutely fine.resp
may be nil (i.e if server is not running)It seems like quite un-obvious behavior (at least for Golang) that may either be possible to fix or at least to documented everywhere, including https://doc.bblf.sh/user/server-grpc-example.html#full-source-of-the-example
Otherwise API users will
on random NPE panics on further
response.UAST
manipulations (which do not propagate any error message).Here is the example of client that works around current behavior, which boils down to
The text was updated successfully, but these errors were encountered: