Make raises work as a context manager