generated from jCloud/repository-template
feat(exceptions): add DirectoryNotEmptyError
Added an OSError subclass for indicating that the directory is not empty. This exception is explicitly handled by the CLI now.
This commit is contained in:
2 files changed
+14
No files matched your search
@@ -20,6 +20,7 @@ import argparse
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
from ..exceptions import DirectoryNotEmptyError
|
||||
from .languages.python import VALID_SECTIONS as VALID_PYTHON_SECTIONS
|
||||
|
||||
__all__ = [
|
||||
@@ -157,6 +158,8 @@ def main(argv=None) -> int:
|
||||
return error(f'{exc.filename}: not a directory')
|
||||
except IsADirectoryError as exc:
|
||||
return error(f'{exc.filename}: is a directory')
|
||||
except DirectoryNotEmptyError as exc:
|
||||
return error(f'{exc.filename}: directory not empty')
|
||||
except FileExistsError as exc:
|
||||
return error(f'{exc.filename}: file already exists')
|
||||
except PermissionError as exc:
|
||||
|
||||
Reference in new issue
Block a user