<jupyter_start><jupyter_text>Error handling  Reraising error:<jupyter_code>def error_method():
    raise Exception('Error')


try:
    error_method()
except Exception:
    raise<jupyter_output><empty_output><jupyter_text>Logging errors:<jupyter_code>import logging
logger = logging.getLogger()
try:
    error_method()
except Exception:
    logger.exception('Message')
    
print('But the program continues to run here...')<jupyter_output>Message
Traceback (most recent call last):
  File "<ipython-input-11-411b169c2cfc>", line 2, in <module>
    error_method()
  File "<ipython-input-6-f8acb62bda86>", line 2, in error_method
    raise Exception('Error')
Exception: Error
{'fraction_non_alphanumeric': 0.11755952380952381, 'fraction_numerical': 0.025297619047619048, 'mean_word_length': 5.598039215686274, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '639114', 'license': 'MIT', 'n_tokens_mistral': 238, 'n_tokens_neox': 226, 'n_words': 50, 'path': 'error_handling.ipynb', 'repo_name': 'martinlarsalbert/python3', 'size': '672'}