When polyglot exits due to error the exit status is 0
See original GitHub issueI’ve run polyglot
a few times to list services or call procedures and every time it returns after a stack trace or some error the process always exists with status code 0. It would be useful if it could return with a non-zero value for the cases where it fails to perform the given operation. Of course there is also the case where we make a call to a procedure (command=call) and the RPC itself returns an error. I think in this last case it would be nice to have another flag added to polyglot
where we can specify what process exit code we want it to return when the RPC itself returns with error, e.g. --rpc_err_exit_code=1
would mean "have the polyglot
process exit with code 1 if RPC error != null`.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
I can install pygamebut as soon as I try to install pgzero it ...
I can install pygamebut as soon as I try to install pgzero it allways ends with an error code ... ERROR: Command errored...
Read more >What is the meaning of exit 0, exit 1, and exit 2 in a bash script?
A successfully executed code should exit with code 0. Other values indicate an error. See for instance Exit Codes With Special Meanings.
Read more >Context (GraalVM SDK Java API Reference)
A polyglot context for Graal guest languages that allows to evaluate code. ... result value or throws a PolyglotException if a guest language...
Read more >Polyglot - yet another Google Translate workflow - Page 4
I've pushed a version of the workflow that should throw a more verbose error, I'm not really confident that it will help but...
Read more >Context (GraalVM SDK Java API Reference)
A polyglot context for Graal guest languages that allows to evaluate code. ... result value or throws a PolyglotException if a guest language...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dinowernli Thanks for the code change in #81.
I wanted to clarify the need for a configurable exit code. More than the configurability aspect, what would be useful is to be able to distinguish when the error is due to a failed gRPC request vs some other error (e.g. error on how
polyglot
was called, or input payload parsing, etc). So, this could be easily addressed by just returning some other exit code for the case where the gRPC fails. There may be room for returning other exit codes under other scenarios, for example, if the gRPC failed because it could not connect to the service (e.g. target service is not running, or not reachable), maybe return exit code “2”, if we can connect to the service and it fails due to other errors then exit with some of other code. Anyway, I’m thinking about how I would usepolyglot
for some simple automated tests, I would not want the test code to assume that some gRPC code broke when in fact it is one of those other cases, like an error on how polyglot was called, or the payload, or the service is still not up and running, etc.@edmund-troche thanks a lot for the examples, these are both cases where the rpc itself fails (rather than the setup or the parsing).
In in https://github.com/grpc-ecosystem/polyglot/pull/81 I have made sure that Polyglot returns a non-zero exit code if the rpc fails. I would rather wait with making the error code configurable until we know that there is really a need for it.