From a09fea8f54e36a5269d2ae0e69e17651c484d040 Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Fri, 10 Apr 2015 13:26:56 +0000 Subject: fixup: ostreeartifactcache: Change some exception stuff --- morphlib/ostreeartifactcache.py | 9 +++++++-- 1 file 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): -- cgit v1.2.1