Commit 9d236fac authored by Toby Dickenson's avatar Toby Dickenson

added DanglingReferenceError. A new exception for storages to report the fact...

added DanglingReferenceError. A new exception for storages to report the fact that a transaction is storing a reference to an object that does not exist. Doing this is 'a bad thing', although it is not entirely clear that it is prohibited. So far only DirectoryStorage makes this check. This is given its own exception class because some code may be able to catch it, and regenerate the object that the storage thinks does not exist.
parent 80387fd3
......@@ -13,8 +13,8 @@
##############################################################################
"""BoboPOS-defined exceptions
$Id: POSException.py,v 1.13 2002/08/22 14:56:31 bwarsaw Exp $"""
__version__ = '$Revision: 1.13 $'.split()[-2:][0]
$Id: POSException.py,v 1.14 2002/09/05 10:19:40 htrd Exp $"""
__version__ = '$Revision: 1.14 $'.split()[-2:][0]
from string import join
from types import StringType, DictType
......@@ -104,6 +104,24 @@ class ConflictError(TransactionError):
def get_serials(self):
return self.serials
class DanglingReferenceError(TransactionError):
"""The transaction stored an object A containing a reference to another
object B, but B does not exist
Instance attributes:
Aoid: oid of the object being written
Boid: referenced oid that does not have a corresponding object
"""
def __init__(self,Aoid,Boid):
self.Aoid = Aoid
self.Boid = Boid
def __str__(self):
return "from %r to %r" % (self.Aoid,self.Boid)
class ReadConflictError(ConflictError):
"""A conflict was detected at read time.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment