Skip to content

Commit

Permalink
Merge pull request #7778 from ic-hep/dirnotexists
Browse files Browse the repository at this point in the history
[v8r0] fix: return correct error for non-existing directory
  • Loading branch information
fstagni authored Sep 11, 2024
2 parents 4bfb083 + a0ca27d commit cc2c6e5
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ def getPathIDs(self, path):
pelements = []
dPath = ""
for el in elements[1:]:
# skip entry path elements, e.g. path has trailing slash
if not el:
continue
dPath += "/" + el
pelements.append(dPath)
pelements.append("/")
Expand All @@ -283,6 +286,8 @@ def getPathIDs(self, path):
result = self.db._query(req)
if not result["OK"]:
return result
if len(result["Value"]) != len(pelements):
return S_ERROR(f"Directory {path} not found")
if not result["Value"]:
return S_ERROR(f"Directory {path} not found")

Expand Down

0 comments on commit cc2c6e5

Please sign in to comment.