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

Bug: Make exit codes more uniform? #482

Open
erikmd opened this issue Apr 21, 2022 · 0 comments
Open

Bug: Make exit codes more uniform? #482

erikmd opened this issue Apr 21, 2022 · 0 comments

Comments

@erikmd
Copy link
Member

erikmd commented Apr 21, 2022

Related issue(s) or PR(s):

Related project scope(s): CLI

Related user(s):

Bug description

We could take the opportunity of releasing 1.0.0 to make the exit codes of the CLI binaries a bit more uniform (issue spotted by @hernoufM in #480) ­— this will need a discussion! so, comments welcome anytime here.

To reproduce

--- learn-ocaml-server_--help.txt~	2022-04-21 20:22:10.206542141 +0200
+++ learn-ocaml-server_--help.txt	2022-04-21 20:45:56.867568714 +0200
+EXIT STATUS
+       learn-ocaml-server exits with the following status:
+
+       0   Default exit.
+
+       2   Uncaught exception.
+
+       10  Server error whose cause is printed on stderr.
+
+       20  Aborting. Server internal error occured in less then 15 seconds
+           after the launch.

--- learn-ocaml_--help.txt~	2022-04-21 20:22:03.714410284 +0200
+++ learn-ocaml_--help.txt	2022-04-21 20:45:56.815567656 +0200
+EXIT STATUS
+       0   Default exit.
+
+       1   Client-side failure whose cause is printed on stderr. Caused by
+           grade or build commands.
+
+       2   Uncaught exception.
+
+       10  Server error whose cause is printed on stderr. Caused by serve
+           command.

--- learn-ocaml-client_--help.txt~	2022-04-21 20:21:58.966313851 +0200
+++ learn-ocaml-client_--help.txt	2022-04-21 20:45:56.855568471 +0200 
+EXIT STATUS
+       learn-ocaml-client exits with the following status:
+
+       0   Default exit.
+
+       1   Server-side error: either unable to reach the server or request
+           has been failed.
+
+       2   Input error: unable to find a file to grade or token isn't valid.
+
+       10  Grading failed.
+
+       70  The client's version is incompatible (too old?) w.r.t. the server.

See also this line:

| `Error _ -> exit 2

which is not the only occurrence of exit 2 in learnocaml_client.ml

Current configuration

  • OS name (and version): N/A
  • Browser name (and version): N/A
  • learn-ocaml --version:
  • git describe --long --always --abbrev=40 --tags: v0.14.0-5-g489455eb8c874726d93a2da1e248d15bdbc15f9e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant