Commit b9e7ca6b authored by Antoine Millet's avatar Antoine Millet
Browse files

Added error handling for unknown objects.

parent 6e29172b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -35,3 +35,6 @@ class BadJobTypeError(Exception):

class UnknownJobError(Exception):
    pass

class UnknownObjectError(Exception):
    pass
+3 −2
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ from threading import RLock

from ccserver.tql import TqlObject
from ccserver.orderedset import OrderedSet
from ccserver.exceptions import AlreadyRegistered
from ccserver.exceptions import AlreadyRegistered, UnknownObjectError

DEFAULT_TTL = 0
TTL_SERVER_DELTA = 1 # Delta to apply for all tags
@@ -107,7 +107,8 @@ class ObjectsDB(object):
            oid = ids.pop()
            obj = self._objects.get(oid)

            assert obj is not None, 'object not found'
            if obj is None:
                raise UnknownObjectError('%r not found in database' % oid)

            if '__parent' in obj:
                # Current object is proxified by a parent: