From 0cebfd140fc969e933d4007d0c7081260fefd378 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 17 Jul 2026 10:50:51 +0800 Subject: [PATCH] bugfix --- unipay/providers/wechat.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/unipay/providers/wechat.py b/unipay/providers/wechat.py index d231817..90ccb8c 100644 --- a/unipay/providers/wechat.py +++ b/unipay/providers/wechat.py @@ -167,13 +167,16 @@ class WechatGateway(Gateway): auth = self._sign("POST", url_path, body_str) async with aiohttp.ClientSession() as session: - async with session.post(url, data=body_str, headers={ - "Authorization": f"WECHATPAY2-SHA256-RSA2048 {auth}", - "Content-Type": "application/json" - }) as resp: - ret = await resp.json() - return ret.get("h5_url") - + try: + async with session.post(url, data=body_str, headers={ + "Authorization": f"WECHATPAY2-SHA256-RSA2048 {auth}", + "Content-Type": "application/json" + }) as resp: + ret = await resp.json() + return ret.get("h5_url") + except EXception as e: + exception(f'{e}, {url=}, {body_str=}, {auth=}') + raise e return None # -----------------------------------------------------