-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch 403 Error for Artifactory backend paths #27
Conversation
Codecov Report
|
I was not really able to create a test to catch the new 403 error as this would require setting up another repository and most likely disable anonymous access, etc. |
or | ||
``requests.exceptions.HTTPError: 403 Client Error`` | ||
error, | ||
which might depend on the instaleld ``dohq-artifactory`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which might depend on the instaleld ``dohq-artifactory`` | |
which might depend on the installed ``dohq-artifactory`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, too late.
As we need this fix as fast as possible I decided to go without review.
return audfactory.path(path).exists() | ||
except RuntimeError: # pragma: nocover | ||
except self._non_existing_path_error: # pragma: nocover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it make sense to catch any Exception
here to avoid the code breaks again in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general it is not a good idea to catch simply everything, because you might also get an exception because you use your keyboard to interrupt or you don't have an internet connection. Those cases we would then also catch.
On the other hand it will make sense easier for us to maintain.
Closes #26
When accessing a non-existing path or a path where you don't have the permission to access it, you might experience a 403 error returned from Artifactory. This started happening only since a few days and most likely it depends on the version of
dohq-artifactory
and maybe if you have anonymous access enabled or not.Here, we don't care, but just catch the corresponding error in order to return a proper
False
forexists()
and an empty list forglob()
.