qmk_firmware icon indicating copy to clipboard operation
qmk_firmware copied to clipboard

[CLI] Don't `exit()` when certain exceptions occur.

Open tzarc opened this issue 2 years ago • 0 comments

Description

CLI code has been written under the assumption that it's run once from the terminal. In cases where it was originally deemed "annoying" to dump out an exception, a hard exit() was invoked instead.

This causes issue with CI, which temporarily loads/unloads the CLI modules. We get random unexplained failures as a result of the exit() calls. This introduces a maybe_exit which allows overriding by CI (later) and thus not killing the process invoking CI.

Types of Changes

  • [ ] Core
  • [ ] Bugfix
  • [ ] New feature
  • [x] Enhancement/optimization
  • [ ] Keyboard (addition or update)
  • [ ] Keymap/layout/userspace (addition or update)
  • [ ] Documentation

Checklist

  • [x] My code follows the code style of this project: C, Python
  • [x] I have read the PR Checklist document and have made the appropriate changes.
  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [x] I have read the CONTRIBUTING document.
  • [ ] I have added tests to cover my changes.
  • [x] I have tested the changes and verified that they work and don't break anything (as well as I can manage).

tzarc avatar Apr 08 '24 10:04 tzarc