Skip to content

Commit

Permalink
fix(notification-dingding): throw error when failed
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnAngela authored Aug 18, 2023
1 parent 9564550 commit 023917b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/notification-providers/dingding.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class DingDing extends NotificationProvider {
text: `## [${this.statusToString(heartbeatJSON["status"])}] ${monitorJSON["name"]} \n> ${heartbeatJSON["msg"]}\n> Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
}
};
if (this.sendToDingDing(notification, params)) {
if (await this.sendToDingDing(notification, params)) {
return okMsg;
}
} else {
Expand All @@ -28,7 +28,7 @@ class DingDing extends NotificationProvider {
content: msg
}
};
if (this.sendToDingDing(notification, params)) {
if (await this.sendToDingDing(notification, params)) {
return okMsg;
}
}
Expand Down Expand Up @@ -59,7 +59,7 @@ class DingDing extends NotificationProvider {
if (result.data.errmsg === "ok") {
return true;
}
return false;
throw new Error(result.data.errmsg);
}

/**
Expand Down

0 comments on commit 023917b

Please sign in to comment.