Add error log

This commit is contained in:
WQY\qiong
2022-11-18 21:58:34 +08:00
parent 2e5f2d8d0b
commit 7a1462e547

View File

@@ -271,8 +271,11 @@ def execute_delete_command(name: str, cs: ChangeSet) -> ChangeSet:
def execute_batch_commands(name: str, cs: ChangeSet) -> ChangeSet:
result = ChangeSet()
todo = {}
try:
for op in cs.operations:
todo = op
operation = op['operation']
if operation == API_ADD:
result.merge(execute_add_command(name, ChangeSet(op)))
@@ -281,6 +284,7 @@ def execute_batch_commands(name: str, cs: ChangeSet) -> ChangeSet:
elif operation == API_DELETE:
result.merge(execute_delete_command(name, ChangeSet(op)))
except:
print(f'ERROR: Fail to execute {todo}!')
pass
return result