shotgunsoftware / tk-core

The Flow Production Tracking Pipeline Toolkit Core API
https://developer.shotgridsoftware.com/tk-core/
Other
91 stars 116 forks source link

SG-35087 Stop masking exceptions #968

Closed carlos-villavicencio-adsk closed 7 months ago

carlos-villavicencio-adsk commented 7 months ago

Sometimes we have support cases with messages like:

[33532 DEBUG sgtk.core.descriptor.io_descriptor.appstore] ...could not establish connection: 'SSLCertVerificationError' object has no attribute 'message'
File "C:\Users\xxxxxxxx\cfg\install\core\scripts\tank_cmd.py", line 1494, in run_engine_cmd
'"tank unregister_folders /path/to/folder"' % exc.message
AttributeError: 'TankInitError' object has no attribute 'message'

Turns out tk-core is raising an error the moment the error is handled.  This PR attempts to fix this by gracefully getting the error description.

codecov[bot] commented 7 months ago

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 79.44%. Comparing base (11d3cd7) to head (c9ad299).

:exclamation: Current head c9ad299 differs from pull request most recent head b8fc2a1. Consider uploading reports for the commit b8fc2a1 to get more accurate results

Files Patch % Lines
python/tank/descriptor/io_descriptor/appstore.py 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #968 +/- ## ========================================== - Coverage 79.45% 79.44% -0.01% ========================================== Files 199 199 Lines 20856 20858 +2 ========================================== Hits 16571 16571 - Misses 4285 4287 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

carlos-villavicencio-adsk commented 7 months ago

I cannot make codecov happy even adding the test it wanted 😢

carlos-villavicencio-adsk commented 7 months ago

@julien-lang Seems like a Py2 Py3 problem. It seems like we were relying on httpllib2 on Py2. I tried using getattr but we might end up losing the error message.