Skip to content

Conversation

@bastimeyer
Copy link
Member

@bastimeyer bastimeyer commented Dec 24, 2022

Just a small cleanup in regards to console.exit() in the main CLI module. This replaces these direct console.exit() calls with a CLIExit exception that gets raised instead and then gets caught down in the main() function. This fixes static code analysis and makes writing tests a bit easier. And it allows for additional cleanup code in case of an error, but nothing of that kind is being implemented here yet. Also no tests for the handling of the CLIExit exceptions themselves, but that's not too important.

Also decided to rewrite the stream-url and JSON tests, because they were pretty bad. Still no improvements of the code being tested, though, and also no error codes, but this can all be done later.

Opening this as a draft for now, because I didn't have the time to check everything in detail yet...

@bastimeyer
Copy link
Member Author

Rebased to master in order to fix missing CI status checks with the new branch protection rules.

In regards to the changes, I will still have to take a closer look. So far, this is just a simple replacement of the console.exit(...) calls with some upgraded tests, but ideally we want to include exit codes.

- Replace various console.exit() calls with a CLIExit() exception
- Fix tests
@bastimeyer
Copy link
Member Author

Rebased and fixed merge conflict. Still need to take a closer look at the changes.

@bastimeyer
Copy link
Member Author

Will open a new PR at some point in the future... This one is old, requires a rebase and lots of more changes.

@bastimeyer bastimeyer closed this Mar 9, 2024
@bastimeyer bastimeyer deleted the cli/clierror branch March 9, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant