diff options
author | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2015-04-10 13:26:56 +0000 |
---|---|---|
committer | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2015-04-10 13:52:27 +0000 |
commit | a09fea8f54e36a5269d2ae0e69e17651c484d040 (patch) | |
tree | 9e88db32de394e0db7b87c8aa1b9bf7f973ea9b4 | |
parent | 207f73f30c1b93a8fadaad80299cbe06876fa18f (diff) | |
download | morph-a09fea8f54e36a5269d2ae0e69e17651c484d040.tar.gz |
fixup: ostreeartifactcache: Change some exception stuff
-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): |