-
Notifications
You must be signed in to change notification settings - Fork 704
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
Logger.catch #224
Comments
Logger catch is very useful, but it is problematic in conjunction with click, especially the error code will always be 0, even if there was an exception. e.g.
If you execute python file.py setup this will set the exit code to 0, expected would be 1 |
@ChristianSauer I assume Because on my computer, it's working fine, the exit code is |
@Delgan yes, you are correct. |
I do agree this is a bit inconvenient. Actually, I just realized that in most of my scripts, I replaced try:
main()
except Exception as e:
logger.opt(exception=True).critical(str(e))
sys.exit(1) That's too bad. It means I'm thinking of adding a new parameter to |
Thats good news, thanks! |
Done. The new |
No description provided.
The text was updated successfully, but these errors were encountered: