Commit 02b5e591 authored by Jim Fulton's avatar Jim Fulton

Include extra data in InvalidObjectReference exceptions to make

debugging easier.
parent 1a888ac3
...@@ -52,11 +52,14 @@ database open function, but this doesn't work: ...@@ -52,11 +52,14 @@ database open function, but this doesn't work:
>>> p2 = MyClass() >>> p2 = MyClass()
>>> conn2.root()['p'] = p2 >>> conn2.root()['p'] = p2
>>> p2.p1 = p1 >>> p2.p1 = p1
>>> tm.commit() # doctest: +NORMALIZE_WHITESPACE >>> tm.commit() # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
Traceback (most recent call last): Traceback (most recent call last):
... ...
InvalidObjectReference: Attempt to store a reference to an object InvalidObjectReference:
from a separate connection to the same database or multidatabase ('Attempt to store a reference to an object from a separate connection to
the same database or multidatabase',
<Connection at ...>,
<ZODB.tests.testcrossdatabasereferences.MyClass object at ...>)
>>> tm.abort() >>> tm.abort()
...@@ -68,11 +71,14 @@ different connections to the same database. ...@@ -68,11 +71,14 @@ different connections to the same database.
>>> p2 = MyClass() >>> p2 = MyClass()
>>> conn2.root()['p'] = p2 >>> conn2.root()['p'] = p2
>>> p2.p1 = p1 >>> p2.p1 = p1
>>> tm.commit() # doctest: +NORMALIZE_WHITESPACE >>> tm.commit() # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
Traceback (most recent call last): Traceback (most recent call last):
... ...
InvalidObjectReference: Attempt to store a reference to an object InvalidObjectReference:
from a separate connection to the same database or multidatabase ('Attempt to store a reference to an object from a separate connection
to the same database or multidatabase',
<Connection at ...>,
<ZODB.tests.testcrossdatabasereferences.MyClass object at ...>)
>>> tm.abort() >>> tm.abort()
......
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