Commit 502a01de authored by Vincent Pelletier's avatar Vincent Pelletier

Replace error code with exception for tidNotFound.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2251 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent cd93ff82
......@@ -1053,8 +1053,7 @@ class Application(object):
Packets.AskTransactionInformation(serial))
except ConnectionClosed:
continue
if self.local_var.txn_info == -1:
except NEOStorageNotFoundError:
# TID not found
continue
if isinstance(self.local_var.txn_info, dict):
......
......@@ -118,7 +118,7 @@ class StorageAnswersHandler(AnswerBaseHandler):
def tidNotFound(self, conn, message):
# This can happen when requiring txn informations
self.app.local_var.txn_info = -1
raise NEOStorageNotFoundError(message)
def answerTIDs(self, conn, tid_list):
self.app.local_var.node_tids[conn.getUUID()] = tid_list
......
......@@ -220,8 +220,8 @@ class StorageAnswerHandlerTests(NeoTestBase):
def test_tidNotFound(self):
conn = self.getConnection()
self.handler.tidNotFound(conn, 'message')
self.assertEqual(self.app.local_var.txn_info, -1)
self.assertRaises(NEOStorageNotFoundError, self.handler.tidNotFound,
conn, 'message')
def test_answerTIDs(self):
uuid = self.getNewUUID()
......
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