Catch all errors and and exceptions

January - 2022

NOTE: Generally speaking this isn't a great idea, but you can catch all errors with:

try:
    with open('file-that-does-not-exit') as _file:
        print('will not make it here')
except Exception as e:
    print(e)
finally:
    print('and we are out')

The general reason to avoid it is that you can't tell what errors are happening and that might lead to unexpected things depending on what you put in the except