repo-cloner/repo_cloner/lib/dir_not_found_error.py

16 lines
350 B
Python
Raw Normal View History

from pathlib import PosixPath
class DirNotFoundError(OSError):
def __str__(self):
if len(self.args) >= 1:
path: str = ""
if isinstance(self.args[0], PosixPath):
path = str(PosixPath(self.args[0]))
else:
path = str(self.args[0])
return f"Directory does not exist / is not a dir: {path}"
else:
return super.__str__(self)