fix: 腾讯短信检测是否发送成功

This commit is contained in:
xinwen
2021-09-15 15:07:34 +08:00
committed by Jiangjie.Bai
parent f3906ff998
commit bf68ddf09e

View File

@@ -82,6 +82,15 @@ class TencentSMS(BaseSMSClient):
resp = self.client.SendSms(req)
try:
code = resp.SendStatusSet[0].Code
msg = resp.SendStatusSet[0].Message
except IndexError:
raise JMSException(code='response_bad', detail=resp)
if code.lower() != 'ok':
raise JMSException(code=code, detail=msg)
return resp
except TencentCloudSDKException as e:
raise JMSException(code=e.code, detail=e.message)