summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--morphlib/__init__.py8
-rw-r--r--morphlib/localrepocache.py5
2 files changed, 11 insertions, 2 deletions
diff --git a/morphlib/__init__.py b/morphlib/__init__.py
index d110296d..121c9431 100644
--- a/morphlib/__init__.py
+++ b/morphlib/__init__.py
@@ -17,6 +17,14 @@
'''Baserock library.'''
+import cliapp
+
+
+class Error(cliapp.AppException):
+
+ '''Base for all morph exceptions that cause user-visible messages.'''
+
+
import artifact
import artifactresolver
import bins
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.