Skip to content

Instantly share code, notes, and snippets.

@abadger
Last active March 15, 2023 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abadger/9b26719e2295d3b683b914e81e44f11c to your computer and use it in GitHub Desktop.
Save abadger/9b26719e2295d3b683b914e81e44f11c to your computer and use it in GitHub Desktop.
Have catchalls reraise KeyboardInterrupt
try:
subscription_manager_stuff()
# Not needed as long as we do not catch BaseException later on
# except KeyboardInterrupt:
# raise
except KnownError:
self.set_result("NICE_ERROR_CODE", "ERROR", "Nice error message")
except (Exception, SystemExit) as e:
self.set_result("UNKNOWN_ERROR", "ERROR", "Unknown Error was returned: %s" % e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment