I would like my python program to raise an error:
import os
if not os.path.isdir(args.sample_dir):
raise OSError('Samples not found.')
When running the code, I receive the following error when the above requirement is met:
Traceback (most recent call last):
File "/Users/blade/utils.py", line 696, in <module>
main()
File "/Users/blade/utils.py", line 663, in main
raise OSError('Samples not found.')
OSError: Samples not found.
I don't like that I see the error sentence twice. Is there a way to hide the earlier one from log?