diff options
author | willmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f> | 2010-07-10 15:29:54 +0000 |
---|---|---|
committer | willmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f> | 2010-07-10 15:29:54 +0000 |
commit | fb95d7bef7a67a927bb66d0bfc8598650c05f04f (patch) | |
tree | 147b4384eab2e22779e5cc6e1c4219b27f797e73 /fs/errors.py | |
parent | 8a504419216d4862a948f2dfce3f058aec74d958 (diff) | |
download | pyfilesystem-git-fb95d7bef7a67a927bb66d0bfc8598650c05f04f.tar.gz |
Added better zip exceptions, and added __all__ to core classes
Diffstat (limited to 'fs/errors.py')
-rw-r--r-- | fs/errors.py | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/fs/errors.py b/fs/errors.py index 82f614d..4bcdeec 100644 --- a/fs/errors.py +++ b/fs/errors.py @@ -5,15 +5,33 @@ All Exception classes are derived from `FSError` which can be used as a catch-al """ +__all__ = ['FSError', + 'CreateFailedError', + 'PathError', + 'OperationFailedError', + 'UnsupportedError', + 'RemoteConnectionError', + 'StorageSpaceError', + 'PermissionDeniedError', + 'FSClosedError', + 'OperationTimeoutError', + 'ResourceError', + 'NoSysPathError', + 'ResourceNotFoundError', + 'ResourceInvalidError', + 'DestinationExistsError', + 'DirectoryNotEmptyError', + 'ParentDirectoryMissingError', + 'ResourceLockedError', + 'convert_fs_errors', + 'convert_os_errors' + ] + import sys import errno from fs.path import * - -try: - from functools import wraps -except ImportError: - wraps = lambda f: lambda f: f +from fs.functools import wraps class FSError(Exception): @@ -41,6 +59,11 @@ class FSError(Exception): return self.__dict__.copy() +class CreateFailedError(FSError): + """An exception thrown when a FS could not be created""" + default_message = "Unable to create filesystem" + + class PathError(FSError): """Exception for errors to do with a path string. """ |