Skip to content

Commit

Permalink
fix(notification-aliyun-sms): throw error when sending SMS failed (#3573
Browse files Browse the repository at this point in the history
)
  • Loading branch information
polunzh authored Aug 14, 2023
1 parent e745bd6 commit c0174dc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/notification-providers/aliyun-sms.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class AliyunSMS extends NotificationProvider {
status: this.statusToString(heartbeatJSON["status"]),
msg: heartbeatJSON["msg"],
});
if (this.sendSms(notification, msgBody)) {
if (await this.sendSms(notification, msgBody)) {
return okMsg;
}
} else {
Expand All @@ -28,7 +28,7 @@ class AliyunSMS extends NotificationProvider {
status: "",
msg: msg,
});
if (this.sendSms(notification, msgBody)) {
if (await this.sendSms(notification, msgBody)) {
return okMsg;
}
}
Expand Down Expand Up @@ -73,7 +73,8 @@ class AliyunSMS extends NotificationProvider {
if (result.data.Message === "OK") {
return true;
}
return false;

throw new Error(result.data.Message);
}

/**
Expand Down

0 comments on commit c0174dc

Please sign in to comment.