fix: send_sms因httperror不处理
This commit is contained in:
parent
0b20386fcc
commit
6bfd5ea9c4
|
@ -13,6 +13,7 @@ def send_sms(phone: str, template_code: int, template_param: dict):
|
|||
config = get_sysconfig()
|
||||
if config['sms'].get('enabled', True) is False:
|
||||
return
|
||||
try:
|
||||
client = AcsClient(config['sms']['xn_key'], config['sms']['xn_secret'], 'default')
|
||||
request = CommonRequest()
|
||||
# 固定json
|
||||
|
@ -44,6 +45,8 @@ def send_sms(phone: str, template_code: int, template_param: dict):
|
|||
else:
|
||||
myLogger.error("短信发送失败:{}-{}-{}-{}".format(phone, template_code, str(template_param), str(res_dict)))
|
||||
return False, res_dict
|
||||
except Exception:
|
||||
myLogger.error("短信发送失败", exc_info=True)
|
||||
|
||||
|
||||
def send_sms_huawei():
|
||||
|
|
Loading…
Reference in New Issue