Skip to content
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

Error codes #126

Merged
merged 2 commits into from
Feb 14, 2024
Merged

Error codes #126

merged 2 commits into from
Feb 14, 2024

Conversation

kpsherva
Copy link
Contributor

No description provided.

Copy link
Contributor

@ntarocco ntarocco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, added a few comments to improve readibility

@@ -149,8 +149,10 @@ def _raise_status(self, path, status):
"""Raise error based on status."""
# 3006 - legacy (v4 errno), 17 - POSIX error, 3018 (xrootd v5 errno)
if status.errno in [3006, 17, 3018]:
if status.message.strip().endswith("directory not empty"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might a bit of more work, but why don't we start creating a small mapping/enum error code: code?
See here and explanation here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the suggestion, I added it to our generic issue about improving errors, for now I patched it until we have some breathing room for proper solution
see #122

@@ -405,7 +407,7 @@ def removedir(self, path, recursive=False, force=False):
status, _ = self._client.rmdir(self._p(path))

if not status.ok:
directory_not_empty_error = status.errno == 3005
directory_not_empty_error = status.errno in [3005, 3018]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like that 3005 is not that error, it is a bit misleading (it was there before).

@kpsherva kpsherva merged commit 6a816f6 into inveniosoftware:master Feb 14, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants