Conversation
| if type(err) == HTTPError: | ||
| print ("There has been an HTTP error after three attempts.") | ||
| exit (2) | ||
| if type(err) == ConnectionError: |
There was a problem hiding this comment.
Same as above comment if err is ConnectionError:
modules/pagereader.py
Outdated
| raise("There has been a connection error after three attempts.") | ||
| if type(err) == HTTPError: | ||
| print ("There has been an HTTP error after three attempts.") | ||
| exit (2) |
There was a problem hiding this comment.
Add a comment explaining what the exit code 2 does.
There was a problem hiding this comment.
changed exit code to 1
as per
https://docs.python.org/3/library/sys.html#sys.exit
Added comments as well
|
done |
modules/pagereader.py
Outdated
| if type(err) == HTTPError: | ||
| print ("There has been an HTTP error after three attempts.") | ||
| #exit 2 to indicate that there has been exception | ||
| exit (2) |
There was a problem hiding this comment.
I meant could you explain what the error code indicates. For example, an error code of 2 in Unix systems usually symbolizes a command line syntax error. We should probably use an error code of 1 because that is used for most other applications.
KingAkeem
left a comment
There was a problem hiding this comment.
Everything looks fine now, I only have one question. Why did you decide to switch to the sys.exit module instead of just raising an exception?
|
used |
|
Are we okay with exit or raising an exception is better? |
|
Exit is sufficient for now, unless we find a need to raise exceptions. |
|
@KingAkeem Please review this PR. |
No description provided.