Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTikhon Uskov <tikhon.uskov@zabbix.com>2021-03-19 17:34:27 +0300
committerTikhon Uskov <tikhon.uskov@zabbix.com>2021-03-19 17:34:27 +0300
commitdb058519dab98eff21bba84d9ce621e085f063f2 (patch)
tree63c5a075f9834dec6f20bed37bf5bae489af3b22 /templates
parent766a5c44d9c13ef333e13e9bfcbc3fa48d0649fb (diff)
.........T [ZBX-18673] fixed error handling
Diffstat (limited to 'templates')
-rw-r--r--templates/media/slack/media_slack.yaml16
1 files changed, 8 insertions, 8 deletions
diff --git a/templates/media/slack/media_slack.yaml b/templates/media/slack/media_slack.yaml
index 67364b1dad5..4c91afadeef 100644
--- a/templates/media/slack/media_slack.yaml
+++ b/templates/media/slack/media_slack.yaml
@@ -1,6 +1,6 @@
zabbix_export:
version: '5.4'
- date: '2021-03-09T02:06:29Z'
+ date: '2021-03-19T10:43:22Z'
media_types:
-
name: Slack
@@ -150,7 +150,7 @@ zabbix_export:
)
));
- if (req.getStatus() != 200 && !resp.ok) {
+ if (req.getStatus() != 200 || !resp.ok || resp.ok === 'false') {
throw 'message was created, but getting message link was failed with reason "' + resp.error + '"';
}
@@ -192,7 +192,7 @@ zabbix_export:
var resp = JSON.parse(req.post(Slack.postMessage, JSON.stringify(fields)));
- if (req.getStatus() != 200 && !resp.ok) {
+ if (req.getStatus() != 200 || !resp.ok || resp.ok === 'false') {
throw resp.error;
}
@@ -214,7 +214,7 @@ zabbix_export:
];
resp = JSON.parse(req.post(Slack.postMessage, JSON.stringify(fields)));
- if (req.getStatus() != 200 && !resp.ok) {
+ if (req.getStatus() != 200 || !resp.ok || resp.ok === 'false') {
throw resp.error;
}
@@ -233,7 +233,7 @@ zabbix_export:
];
resp = JSON.parse(req.post(Slack.chatUpdate, JSON.stringify(fields)));
- if (req.getStatus() != 200 && !resp.ok) {
+ if (req.getStatus() != 200 || !resp.ok || resp.ok === 'false') {
throw resp.error;
}
}
@@ -257,7 +257,7 @@ zabbix_export:
var resp = JSON.parse(req.post(Slack.postMessage, JSON.stringify(fields)));
- if (req.getStatus() != 200 && !resp.ok) {
+ if (req.getStatus() != 200 || !resp.ok || resp.ok === 'false') {
throw resp.error;
}
@@ -278,7 +278,7 @@ zabbix_export:
resp = JSON.parse(req.post(Slack.postMessage, JSON.stringify(fields)));
- if (req.getStatus() != 200 && !resp.ok) {
+ if (req.getStatus() != 200 || !resp.ok || resp.ok === 'false') {
throw resp.error;
}
@@ -295,7 +295,7 @@ zabbix_export:
resp = JSON.parse(req.post(Slack.postMessage, JSON.stringify(fields)));
- if (req.getStatus() != 200 && !resp.ok) {
+ if (req.getStatus() != 200 || !resp.ok || resp.ok === 'false') {
throw resp.error;
}
}