summaryrefslogtreecommitdiff
path: root/fs/errors.py
diff options
context:
space:
mode:
authorwillmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f>2010-07-10 15:29:54 +0000
committerwillmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f>2010-07-10 15:29:54 +0000
commite839414799d424a39cc60ae7d943d9d64fec0a1c (patch)
tree147b4384eab2e22779e5cc6e1c4219b27f797e73 /fs/errors.py
parenta7365283fdb0b8501c43c4fc1e4ca24b79c0e7eb (diff)
downloadpyfilesystem-e839414799d424a39cc60ae7d943d9d64fec0a1c.tar.gz
Added better zip exceptions, and added __all__ to core classes
git-svn-id: http://pyfilesystem.googlecode.com/svn/trunk@378 67cdc799-7952-0410-af00-57a81ceafa0f
Diffstat (limited to 'fs/errors.py')
-rw-r--r--fs/errors.py33
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.
"""