# HG changeset patch # User RhodeCode Admin # Date 2024-02-28 08:30:11 # Node ID d7dccd8eb2f39d58b1fb5a29288306b4dabac2a5 # Parent 905c58f20e30079197777cbb7233debcefc08d00 fix(pycurl): report nicer error log on failed calls in pycurl diff --git a/rhodecode/lib/vcs/__init__.py b/rhodecode/lib/vcs/__init__.py --- a/rhodecode/lib/vcs/__init__.py +++ b/rhodecode/lib/vcs/__init__.py @@ -136,7 +136,12 @@ class CurlSession(object): curl.setopt(curl.FOLLOWLOCATION, allow_redirects) curl.setopt(curl.WRITEDATA, response_buffer) curl.setopt(curl.HTTPHEADER, headers_list) - curl.perform() + + try: + curl.perform() + except pycurl.error as exc: + log.error('Failed to call endpoint url: {} using pycurl'.format(url)) + raise status_code = curl.getinfo(pycurl.HTTP_CODE) content_type = curl.getinfo(pycurl.CONTENT_TYPE)