Parcourir la source

fix(account): sync-all 添加支付宝错误日志便于排查

alphah il y a 2 semaines
Parent
commit
05b9fe97f1
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4 1
      backend/app/plugin/module_payment/account/service.py

+ 4 - 1
backend/app/plugin/module_payment/account/service.py

@@ -954,6 +954,9 @@ class AccountService:
                     batch_result.parse_response_content(response)
                     if not batch_result.is_success():
                         errors += 1
+                        err_code = getattr(batch_result, 'sub_code', None) or getattr(batch_result, 'code', '')
+                        err_msg = getattr(batch_result, 'sub_msg', None) or getattr(batch_result, 'msg', '')
+                        log.warning(f"全量同步 - 企业 {eid} 第 {page_num} 页查询失败: [{err_code}] {err_msg}")
                         break
 
                     consume_list = getattr(batch_result, 'consume_info_list', None)
@@ -1043,7 +1046,7 @@ class AccountService:
 
                 except Exception as e:
                     errors += 1
-                    log.warning(f"全量同步 - 企业 {eid} 第 {page_num} 页异常: {e}")
+                    log.warning(f"全量同步 - 企业 {eid} 第 {page_num} 页异常: {e}", exc_info=True)
                     break
 
                 # 翻页:API 无 total_page_count,用返回条数判断