Lacking some essential parameters should provide helpful information instead of exceptions:
19:30 $ python gtrackcore/track_operations/gtools/GTools.py import
Traceback (most recent call last):
File "gtrackcore/track_operations/gtools/GTools.py", line 201, in <module>
GTools()
File "gtrackcore/track_operations/gtools/GTools.py", line 30, in __init__
self.runOperation()
File "gtrackcore/track_operations/gtools/GTools.py", line 53, in runOperation
btrack = BTrack(self._args.btrackPath)
File "/Users/sveinugu/PycharmProjects/gtrackcore/gtrackcore/api/BTrack.py", line 15, in __init__
self._path = os.path.abspath(path)
File "/Users/sveinugu/miniconda2/lib/python2.7/posixpath.py", line 360, in abspath
if not isabs(path):
File "/Users/sveinugu/miniconda2/lib/python2.7/posixpath.py", line 54, in isabs
return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith
Also, it would be prettier if such validation exceptions were only print statements, and not full exceptions with stacktrace:
python gtrackcore/track_operations/gtools/GTools.py create -b test.btrack
Traceback (most recent call last):
File "gtrackcore/track_operations/gtools/GTools.py", line 201, in <module>
GTools()
File "gtrackcore/track_operations/gtools/GTools.py", line 30, in __init__
self.runOperation()
File "gtrackcore/track_operations/gtools/GTools.py", line 47, in runOperation
BTrack(self._args.btrackPath, self._args.genomePath)
File "/Users/sveinugu/PycharmProjects/gtrackcore/gtrackcore/api/BTrack.py", line 23, in __init__
raise ValueError('Genome has to be provided')
ValueError: Genome has to be provided
Lacking some essential parameters should provide helpful information instead of exceptions:
Also, it would be prettier if such validation exceptions were only print statements, and not full exceptions with stacktrace: