aboutsummaryrefslogtreecommitdiffstats
path: root/dotfiles/exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/exceptions.py')
-rw-r--r--dotfiles/exceptions.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/dotfiles/exceptions.py b/dotfiles/exceptions.py
index 9623ecc..cb6021c 100644
--- a/dotfiles/exceptions.py
+++ b/dotfiles/exceptions.py
@@ -1,6 +1,5 @@
class DotfileException(Exception):
"""An exception the CLI can handle and show to the user."""
-
def __init__(self, path, message='an unknown error occurred'):
self.message = '\'%s\' %s' % (path, message)
Exception.__init__(self, self.message)
@@ -10,54 +9,55 @@ class DotfileException(Exception):
class IsDirectory(DotfileException):
-
def __init__(self, path):
DotfileException.__init__(self, path, 'is a directory')
class IsSymlink(DotfileException):
-
def __init__(self, path):
DotfileException.__init__(self, path, 'is a symlink')
class NotASymlink(DotfileException):
-
def __init__(self, path):
DotfileException.__init__(self, path, 'is not a symlink')
class InRepository(DotfileException):
-
def __init__(self, path):
DotfileException.__init__(self, path, 'is within the repository')
class NotRootedInHome(DotfileException):
-
def __init__(self, path):
DotfileException.__init__(self, path, 'not rooted in home directory')
class Exists(DotfileException):
-
def __init__(self, path):
DotfileException.__init__(self, path, 'already exists')
-class TargetIgnored(DotfileException):
+class NotFound(DotfileException):
+ def __init__(self, path):
+ DotfileException.__init__(self, path, 'not found')
+
+
+class Dangling(DotfileException):
+ def __init__(self, path):
+ DotfileException.__init__(self, path, 'is a dangling symlink')
+
+class TargetIgnored(DotfileException):
def __init__(self, path):
DotfileException.__init__(self, path, 'targets an ignored file')
class TargetExists(DotfileException):
-
def __init__(self, path):
DotfileException.__init__(self, path, 'target already exists')
class TargetMissing(DotfileException):
-
def __init__(self, path):
DotfileException.__init__(self, path, 'target is missing')