As per SYNR-1113, there are two areas in the Python client where exception handling could be better:
(1) Exception chaining: When raising a caught exception, be sure to do so with the 'except' block that caught it to utilize Python's exception chaining. See https://stackoverflow.com/questions/16414744/python-exception-chaining
(2) When retrying on exception, do so selectively. In _downloadFileHandle() there is a try/except which retries download on every exception thrown. In there was an exception which was not retryable. Retrying caused another problem to occur which masked the root cause. It would be helpful not to retry 'permanent failures' but rather to simply raise such exceptions.
This pull request shows the correction for (1):
https://github.com/Sage-Bionetworks/synapsePythonClient/pull/432
I'm cherry-picking this into the py-1.7.3 release in addition to working on so we can properly log errors that users will experience.
Since Bruce was the one who made the pull request, I've corrected the assignee to him
Verified that the tracebacks are being included