Print Exception Message Python - Raise exception except exception as e: Web to print the exceptions, we use ‘as’ keyword of python. We have used the same example that we used before. Print(getattr(e, 'message', repr(e))) print(getattr(e, 'message', str(e))).
We have used the same example that we used before. Print(getattr(e, 'message', repr(e))) print(getattr(e, 'message', str(e))). Raise exception except exception as e: Web to print the exceptions, we use ‘as’ keyword of python.