by valbaca · 2y ago · 0 comments
print(f"Unexpected error: {error}")
sys.exit(1)
How is that any different than just letting the exception throw all the way out?Is all this doing is making sure the exit code is 1 instead of some other non-zero value?
I'm not seeing how this is any better than just letting the program hard-crash.
(I am asking in earnest. I'm getting back into Python and wanting to know what's generally preferred)
It's often more user friendly to print a short human-readable message (or nothing) than to dump a huge stack trace. YMMV, if this is an internal dev tool then the opposite might be true!