Skip to content

Bug: Make exit codes more uniform? #482

@erikmd

Description

@erikmd

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions