For `__exit__` you return `True` if you want to suppress an exception, or `False` if you want it to be re-raised by python automatically when the `with` block exits. I don't think raising your own exceptions works.