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): ...@@ -1053,8 +1053,7 @@ class Application(object):
Packets.AskTransactionInformation(serial)) Packets.AskTransactionInformation(serial))
except ConnectionClosed: except ConnectionClosed:
continue continue
except NEOStorageNotFoundError:
if self.local_var.txn_info == -1:
# TID not found # TID not found
continue continue
if isinstance(self.local_var.txn_info, dict): if isinstance(self.local_var.txn_info, dict):
......
...@@ -118,7 +118,7 @@ class StorageAnswersHandler(AnswerBaseHandler): ...@@ -118,7 +118,7 @@ class StorageAnswersHandler(AnswerBaseHandler):
def tidNotFound(self, conn, message): def tidNotFound(self, conn, message):
# This can happen when requiring txn informations # This can happen when requiring txn informations
self.app.local_var.txn_info = -1 raise NEOStorageNotFoundError(message)
def answerTIDs(self, conn, tid_list): def answerTIDs(self, conn, tid_list):
self.app.local_var.node_tids[conn.getUUID()] = tid_list self.app.local_var.node_tids[conn.getUUID()] = tid_list
......
...@@ -220,8 +220,8 @@ class StorageAnswerHandlerTests(NeoTestBase): ...@@ -220,8 +220,8 @@ class StorageAnswerHandlerTests(NeoTestBase):
def test_tidNotFound(self): def test_tidNotFound(self):
conn = self.getConnection() conn = self.getConnection()
self.handler.tidNotFound(conn, 'message') self.assertRaises(NEOStorageNotFoundError, self.handler.tidNotFound,
self.assertEqual(self.app.local_var.txn_info, -1) conn, 'message')
def test_answerTIDs(self): def test_answerTIDs(self):
uuid = self.getNewUUID() 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