question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jc swallows exit codes

See original GitHub issue

When running jc some_program, even if some_program exits with non-zero exit code, jc exits with zero:

$ jc ifconfig eth0
eth0: error fetching interface information: Device not found
[]
$ echo $?
0

Otherwise clean and straightforward integration with Next Generation Shell behaves incorrectly (with regard to errors) due to this issue.

``jc ...`` # should throw an exception but can't because exit code is  0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kellyjonbrazilcommented, May 11, 2021

This is now working on the dev branch. I added the following section to the Readme and man page:

Exit Codes

Any fatal errors within jc will generate an exit code of 100, otherwise the exit code will be 0. When using the “magic” syntax (e.g. jc ifconfig eth0), jc will store the exit code of the program being parsed and add it to the jc exit code. This way it is easier to determine if an error was from the parsed program or jc.

Consider the following examples using ifconfig:

ifconfig exit code jc exit code Combined exit code Interpretation
0 0 0 No errors
1 0 1 Error in ifconfig
0 100 100 Error in jc
1 100 101 Error in both ifconfig and jc
0reactions
kellyjonbrazilcommented, May 17, 2021

v1.15.4 is now available via pip and includes this functionality.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kelly Brazil on Twitter: "jc's "Magic" syntax no longer swallows exit ...
jc's "Magic" syntax no longer swallows exit codes. $ jc ifconfig foo ifconfig: interface foo does not exist [] $ echo $? 1...
Read more >
Interpreting Joint Commission Standards: FAQs
Use this list of FAQs to interpret Joint Commission standards for specific areas.
Read more >
J.C. Swallow Thesis - CERN Document Server
Joel C. Swallow. A thesis submitted to the University of Birmingham for the degree of Doctor Of Philosophy. Particle Physics Research Group.
Read more >
podman-compose run swallows exit code · Issue #408 - GitHub
As far as I read the source code, that means that the run() method of Podman needs to sys.exit() if the podman command...
Read more >
MBSImP™ Standardized Training And Reliability Testing #e01
Participants are tested on their newly acquired skill in using the MBSImP scoring metric to successfully capture and profile swallowing impairment in adults....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found