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

JSON format for exitcode could be simplified #6

Closed
haxtibal opened this issue May 11, 2021 · 1 comment · Fixed by #10
Closed

JSON format for exitcode could be simplified #6

haxtibal opened this issue May 11, 2021 · 1 comment · Fixed by #10
Assignees
Labels
bug Something isn't working
Milestone

Comments

@haxtibal
Copy link

haxtibal commented May 11, 2021

The JSON exitcode attribute from a /v1/checker?command=foo response is a bit nasty to deserialize in statically typed languages, because its type varies in uncommon way:

  • if a command can be executed, the real exit code is propagated like {"excitcode": 0}, i.e. integer
  • if a command is not available for execution, we get {"excitcode": {}}, i.e. empty object

Integer has no empty form. A better representation would IMO be integer or null. This could be deserialized out of the box to e.g. Optional<int>.

@LordHepipud LordHepipud added this to the v1.2.0 milestone Jun 11, 2021
@LordHepipud LordHepipud added the bug Something isn't working label Jun 11, 2021
@LordHepipud LordHepipud self-assigned this Jun 11, 2021
@LordHepipud
Copy link
Contributor

Thank you for the issue. Honestly the exit code should be 3 in case something fails, to always be able to return UNKNOWN.
I believe there is some error with handling errors properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants