Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTools command line parameter validation needs to improve #1

Open
sveinugu opened this issue May 28, 2019 · 0 comments
Open

GTools command line parameter validation needs to improve #1

sveinugu opened this issue May 28, 2019 · 0 comments
Assignees

Comments

@sveinugu
Copy link
Collaborator

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
@sveinugu sveinugu assigned sveinugu and radmilak and unassigned sveinugu May 28, 2019
@sveinugu sveinugu assigned sveinugu and unassigned radmilak Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants