Skip to content

Commit

Permalink
Handle "File not found." artifactory response as OSError (#438)
Browse files Browse the repository at this point in the history
* Handle "File not found." artifactory response as OSError

Fix for #437

* Apply suggestions from code review

Co-authored-by: Anthony Ilinykh <[email protected]>

---------

Co-authored-by: Alex <[email protected]>
  • Loading branch information
ailinykh and allburov authored Dec 12, 2023
1 parent 9a1432f commit 3735e88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion artifactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ def get_stat_json(self, pathobj, key=None):
)
code = response.status_code
text = response.text
if code == 404 and ("Unable to find item" in text or "Not Found" in text):
if code == 404 and ("Unable to find item" in text or "Not Found" in text or "File not found" in text):
raise OSError(2, f"No such file or directory: {url}")

raise_for_status(response)
Expand Down

0 comments on commit 3735e88

Please sign in to comment.