diff options
Diffstat (limited to 'morphlib/ostreeartifactcache.py')
-rw-r--r-- | morphlib/ostreeartifactcache.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/morphlib/ostreeartifactcache.py b/morphlib/ostreeartifactcache.py index ed060e59..f0fd6b56 100644 --- a/morphlib/ostreeartifactcache.py +++ b/morphlib/ostreeartifactcache.py @@ -29,6 +29,12 @@ import morphlib from morphlib.artifactcachereference import ArtifactCacheReference +class NotCachedError(morphlib.Error): + + def __init__(self, ref): + self.msg = 'Failed to checkout %s from the artifact cache.' % ref + + class OSTreeArtifactCache(object): """Class to provide the artifact cache API using an OSTree repo.""" @@ -165,8 +171,7 @@ class OSTreeArtifactCache(object): self.repo.touch_ref(ref) except GLib.GError as e: logging.debug('OSTree raised an exception: %s' % e) - raise cliapp.AppException('Failed to checkout %s from artifact ' - 'cache.' % ref) + raise NotCachedError(ref) return directory def list_contents(self): |