-
Notifications
You must be signed in to change notification settings - Fork 5
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
Print error messages on stderr consistently #8
base: dev
Are you sure you want to change the base?
Conversation
In general, I wouldn't handle errors that way (printing and exiting), but rather raise a custom Python exception. |
@@ -575,23 +580,35 @@ def genome_mode(reference, reads, start, end, compress, para, tab): | |||
try: | |||
start = int(start)-1 | |||
end = int(end) | |||
except Exception: | |||
print('User Error: invalid start/end coordinate(s)') | |||
except ValueError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also note that the try/except won't catch negative values, if that's the intention.
This pull request introduces 1 alert and fixes 2 when merging 77e91e7 into 52fd2a1 - view on LGTM.com new alerts:
fixed alerts:
|
@@ -561,7 +563,10 @@ def check_tab(tab): | |||
if int(tab) in [1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 14, 15, 16, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use a range here!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and do the int
conversion outside of the function to avoid the duplicated action
No description provided.