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 and louislam committed Jan 19, 2024
1 parent 7635ab5 commit 8bedf35
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 8bedf35

Please sign in to comment.