Now using a context manager for testing exception. Also test the exception message returned.