Connectivity exception not handled
We had a case where the "coveralls" command failed with an exception traceback because it did not handle the connectivity error. For details, see this log (in that case, we use coveralls 2.1.2, but I checked the master branch of coveralls and the problem is still in the master branch).
The start of the problem was a "socket.gaierror: [Errno -3] Temporary failure in name resolution" that bubbled up and was raised from requests.post() as a requests.exceptions.ConnectionError. I suspect that the root cause was a temporary issue in the network, but nevertheless it should not result in "coveralls" failing with a traceback but instead to fail with a return code and a proper error message.
The following code in coveralls/api.py performs that requests.post() and does not handle any exception raised by it:
def submit_report(self, json_string):
endpoint = '{}/api/v1/jobs'.format(self._coveralls_host.rstrip('/'))
verify = not bool(os.environ.get('COVERALLS_SKIP_SSL_VERIFY'))
response = requests.post(endpoint, files={'json_file': json_string},
verify=verify)
. . .
I suggest that all requests exceptions that can be raised from requests.post() are transformed into a CoverallsException, which is handled at the top level.
PR #339 addresses this issue.