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
@@ -12,6 +12,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import errno
|
||||
|
||||
|
||||
class NamespaceError(ValueError):
|
||||
"""
|
||||
@@ -101,3 +103,12 @@ class PythonDefinitionError(ValueError):
|
||||
|
||||
|
||||
class PythonArgumentStructureError(PythonDefinitionError): ...
|
||||
|
||||
|
||||
class DirectoryNotEmptyError(OSError):
|
||||
"""
|
||||
Directory is not empty.
|
||||
"""
|
||||
|
||||
def __init__(self, filename: str | None = None) -> None:
|
||||
super().__init__(errno.ENOTEMPTY, 'Directory not empty', filename)
|
||||
Reference in new issue
Block a user