Closed castanley closed 4 weeks ago
Attention: Patch coverage is 42.85714%
with 16 lines
in your changes missing coverage. Please review.
Project coverage is 53.65%. Comparing base (
80e3969
) to head (8a0432c
). Report is 46 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hey @castanley - thanks a lot for your contribution to the project! I've integrated your suggestions with some additional housekeeping and tweaks for optimization.
Your changes are now merged! 🚀
Looking forward to more collaboration in the future.
Best, Daniel
Description
This pull request refactors the exception handling in
protect_archiver
. The following changes were made:ProtectError
,DownloadFailed
, andAuthorizationFailed
as subclasses of a baseErrors
class inerrors.py
.download_file.py
to correctly import these exceptions.Changes
errors.py
: DefinedProtectError
,DownloadFailed
, andAuthorizationFailed
as subclasses ofErrors
.download_file.py
: Updated import statements to use the newly defined exceptions.Motivation and Context
This refactor resolves the following issues:
AttributeError: 'NoneType' object has no attribute 'get'
None
being accessed incorrectly.TypeError: catching classes that do not inherit from BaseException is not allowed
BaseException
. The new hierarchy ensures that all custom exceptions are correctly defined as subclasses ofErrors
, which inherits fromException
.How Has This Been Tested?
download_file.py
and other modules import and use the exceptions without issues.