Created
December 29, 2019 07:16
-
-
Save dtoma/fe6eea1327705c24c35086a73924d26d to your computer and use it in GitHub Desktop.
Python exception handling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://speakerdeck.com/pycon2019/mario-corchero-how-to-properly-raise-handle-and-create-them?slide=50 | |
try: | |
# ... | |
exception (KeyError, ValueError): | |
logging.info('Attempted to call x with invalid input', exc_info=True) | |
raise InvalidDataCustomError('Invalid data used to call X') from None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment