From 7a1462e547fb8ab718c490e798748ba911cfe19e Mon Sep 17 00:00:00 2001 From: "WQY\\qiong" Date: Fri, 18 Nov 2022 21:58:34 +0800 Subject: [PATCH] Add error log --- api/command.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/command.py b/api/command.py index e48a732..82d72fb 100644 --- a/api/command.py +++ b/api/command.py @@ -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