summaryrefslogtreecommitdiff
path: root/fs/errors.py
diff options
context:
space:
mode:
authorbtimby <btimby@67cdc799-7952-0410-af00-57a81ceafa0f>2012-04-20 19:17:32 +0000
committerbtimby <btimby@67cdc799-7952-0410-af00-57a81ceafa0f>2012-04-20 19:17:32 +0000
commit083d6f32ca749a68541e54c86d95582a3ed46377 (patch)
tree47a414710dbdf1a07144f4f025a5b234acb574fb /fs/errors.py
parentd04d263597a8f2c19e3ab7dcc7374704ed1d2ac4 (diff)
downloadpyfilesystem-083d6f32ca749a68541e54c86d95582a3ed46377.tar.gz
Use explicit exception to detect invalid path (BackReferenceError), see comments on r773
git-svn-id: http://pyfilesystem.googlecode.com/svn/trunk@775 67cdc799-7952-0410-af00-57a81ceafa0f
Diffstat (limited to 'fs/errors.py')
-rw-r--r--fs/errors.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/errors.py b/fs/errors.py
index 38cb4b7..93f8905 100644
--- a/fs/errors.py
+++ b/fs/errors.py
@@ -188,6 +188,11 @@ class NoMMapError(ResourceError):
default_message = "Can't get mmap for %(path)s"
+class BackReferenceError(FSError, ValueError):
+ """Exception raised when too many backrefs exist in a path (ex: '/..', '/docs/../..')."""
+ default_message = "Too many backrefs in '%(path)s'"
+
+
def convert_fs_errors(func):
"""Function wrapper to convert FSError instances into OSError."""
@wraps(func)