Skip to content

Commit

Permalink
Merge pull request #281 from billdodd/fix/issue-277
Browse files Browse the repository at this point in the history
Send traceback to debug logging only, not to HTML report
  • Loading branch information
mraineri authored Oct 4, 2018
2 parents af30662 + f1b53a9 commit 76e1d81
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions traverseService.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ def callResourceURI(self, URILink):
# rs-assertion: must have application/json or application/xml
traverseLogger.debug('callingResourceURI {}with authtype {} and ssl {}: {} {}'.format(
'out of service ' if not inService else '', AuthType, UseSSL, URILink, headers))
response = None
try:
if payload is not None and CacheMode == 'Prefer':
return True, payload, -1, 0
Expand Down Expand Up @@ -459,22 +460,24 @@ def callResourceURI(self, URILink):
.format(URILink, statusCode, responses[statusCode], cred_type, AuthType))

except requests.exceptions.SSLError as e:
traverseLogger.error("SSLError on {}".format(URILink))
traverseLogger.error("SSLError on {}: {}".format(URILink, repr(e)))
traverseLogger.debug("output: ", exc_info=True)
except requests.exceptions.ConnectionError as e:
traverseLogger.error("ConnectionError on {}".format(URILink))
traverseLogger.error("ConnectionError on {}: {}".format(URILink, repr(e)))
traverseLogger.debug("output: ", exc_info=True)
except requests.exceptions.Timeout as e:
traverseLogger.error("Request has timed out ({}s) on resource {}".format(timeout, URILink))
traverseLogger.debug("output: ", exc_info=True)
except requests.exceptions.RequestException as e:
traverseLogger.error("Request has encounted a problem when getting resource {}".format(URILink))
traverseLogger.warning("output: ", exc_info=True)
traverseLogger.error("Request has encounted a problem when getting resource {}: {}".format(URILink, repr(e)))
traverseLogger.debug("output: ", exc_info=True)
except AuthenticationError as e:
raise e # re-raise exception
except Exception:
traverseLogger.error("A problem when getting resource has occurred {}".format(URILink))
traverseLogger.warning("output: ", exc_info=True)
except Exception as e:
traverseLogger.error("A problem when getting resource {} has occurred: {}".format(URILink, repr(e)))
traverseLogger.debug("output: ", exc_info=True)
if response and response.text:
traverseLogger.debug("payload: {}".format(response.text))

if payload is not None and CacheMode == 'Fallback':
return True, payload, -1, 0
Expand Down

0 comments on commit 76e1d81

Please sign in to comment.