mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-27 22:49:42 -08:00
Updated octopush error handling to accept 000
The legacy octopush API includes an error code with all responses. A code other than 000 is an error. Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
This commit is contained in:
parent
63e408f4f2
commit
97de3959cd
|
@ -54,8 +54,10 @@ class Octopush extends NotificationProvider {
|
||||||
// response data
|
// response data
|
||||||
let response = await axios.post("https://www.octopush-dm.com/api/sms/json", {}, config);
|
let response = await axios.post("https://www.octopush-dm.com/api/sms/json", {}, config);
|
||||||
if ("error_code" in response.data) {
|
if ("error_code" in response.data) {
|
||||||
|
if (response.data.error_code !== "000") {
|
||||||
this.throwGeneralAxiosError(`Octopush error ${JSON.stringify(response.data)}`);
|
this.throwGeneralAxiosError(`Octopush error ${JSON.stringify(response.data)}`);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error("Unknown Octopush version!");
|
throw new Error("Unknown Octopush version!");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue