summaryrefslogtreecommitdiff
path: root/git/exc.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2011-05-30 13:06:37 +0200
committerSebastian Thiel <byronimo@gmail.com>2011-05-30 13:06:37 +0200
commit024adf37acddd6a5d8293b6b5d15795c59a142c0 (patch)
tree3610b99168f984acb0eefe3a995295f4d3b1d096 /git/exc.py
parent112bb1672d6b28f203e7839e320b985486636800 (diff)
downloadgitpython-024adf37acddd6a5d8293b6b5d15795c59a142c0.tar.gz
Fixed tests far enough to allow basic repository tests to be applied to any of the new database types. This reduces code duplication to the mere minimum, but allows custom tests to be added on top easily and flexibly
Diffstat (limited to 'git/exc.py')
-rw-r--r--git/exc.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/git/exc.py b/git/exc.py
index 3c69067c..412f82f0 100644
--- a/git/exc.py
+++ b/git/exc.py
@@ -7,7 +7,10 @@
from util import to_hex_sha
-class ODBError(Exception):
+class GitPythonError(Exception):
+ """Base exception for all git-python related errors"""
+
+class ODBError(GitPythonError):
"""All errors thrown by the object database"""
@@ -40,15 +43,15 @@ class UnsupportedOperation(ODBError):
"""Thrown if the given operation cannot be supported by the object database"""
-class InvalidGitRepositoryError(Exception):
+class InvalidGitRepositoryError(GitPythonError):
""" Thrown if the given repository appears to have an invalid format. """
-class NoSuchPathError(OSError):
+class NoSuchPathError(GitPythonError):
""" Thrown if a path could not be access by the system. """
-class GitCommandError(Exception):
+class GitCommandError(GitPythonError):
""" Thrown if execution of the git command fails with non-zero status code. """
def __init__(self, command, status, stderr=None):
self.stderr = stderr
@@ -60,7 +63,7 @@ class GitCommandError(Exception):
(' '.join(str(i) for i in self.command), self.status, self.stderr))
-class CheckoutError( Exception ):
+class CheckoutError(GitPythonError):
"""Thrown if a file could not be checked out from the index as it contained
changes.
@@ -83,7 +86,7 @@ class CheckoutError( Exception ):
return Exception.__str__(self) + ":%s" % self.failed_files
-class CacheError(Exception):
+class CacheError(GitPythonError):
"""Base for all errors related to the git index, which is called cache internally"""