Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pyagentx/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,11 @@ def _start_network(self):

elif request.type == pyagentx.AGENTX_COMMITSET_PDU:
for handler in self._sethandlers.values():
handler.network_commit(request.session_id, request.transaction_id)
try:
handler.network_commit(request.session_id, request.transaction_id)
except:
response.error = pyagentx.ERROR_COMMITFAILED
response.error_index = 1
logger.info("Received COMMITSET PDU")

elif request.type == pyagentx.AGENTX_UNDOSET_PDU:
Expand Down
10 changes: 5 additions & 5 deletions pyagentx/sethandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ def network_commit(self, session_id, transaction_id):
tid = "%s_%s" % (session_id, transaction_id)
try:
oid, data = self.transactions[tid]
self.commit(oid, data)
if tid in self.transactions:
del(self.transactions[tid])
except:
logger.error('CommitSet failed')
except KeyError:
return
self.commit(oid, data)
if tid in self.transactions:
del(self.transactions[tid])

def network_undo(self, session_id, transaction_id):
tid = "%s_%s" % (session_id, transaction_id)
Expand Down