summaryrefslogtreecommitdiff
path: root/morphlib/localrepocache.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-25 16:00:52 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-04-25 16:00:52 +0100
commit8185ac21732bcc784b678da5954ab3cf16078fa8 (patch)
tree412c651f2aac7395312617b2fd5c81d42098cc41 /morphlib/localrepocache.py
parentff7327e84f75e14363ba2790b54ceed257a5f25e (diff)
downloadmorph-8185ac21732bcc784b678da5954ab3cf16078fa8.tar.gz
Add morphlib.Error and make local repo cache exceptions be based on it
This way, cliapp will automatically print an error message, rather than a stack trace.
Diffstat (limited to 'morphlib/localrepocache.py')
-rw-r--r--morphlib/localrepocache.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/morphlib/localrepocache.py b/morphlib/localrepocache.py
index 5e04b187..b8dfea88 100644
--- a/morphlib/localrepocache.py
+++ b/morphlib/localrepocache.py
@@ -34,7 +34,7 @@ urlparse.uses_fragment.extend(gitscheme)
-class NoRemote(Exception):
+class NoRemote(morphlib.Error):
def __init__(self, reponame, errors):
self.reponame = reponame
@@ -44,13 +44,14 @@ class NoRemote(Exception):
return '\n\t'.join(['Cannot find remote git repository: %s' %
self.reponame] + self.errors)
-class NotCached(Exception):
+class NotCached(morphlib.Error):
def __init__(self, reponame):
self.reponame = reponame
def __str__(self): # pragma: no cover
return 'Repository %s is not cached yet' % self.reponame
+
class LocalRepoCache(object):
'''Manage locally cached git repositories.