Fix error code if else in webhooks (#10386)

This commit is contained in:
Sriharsha Chintalapani 2023-03-07 12:58:19 -08:00 committed by GitHub
parent 63e285ef8f
commit b42f457d88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -62,7 +62,7 @@ public class GChatWebhookPublisher extends AlertsActionPublisher {
if (response.getStatus() >= 300 && response.getStatus() < 400) { if (response.getStatus() >= 300 && response.getStatus() < 400) {
// 3xx response/redirection is not allowed for callback. Set the webhook state as in error // 3xx response/redirection is not allowed for callback. Set the webhook state as in error
setErrorStatus(attemptTime, response.getStatus(), response.getStatusInfo().getReasonPhrase()); setErrorStatus(attemptTime, response.getStatus(), response.getStatusInfo().getReasonPhrase());
} else if (response.getStatus() >= 300 && response.getStatus() < 600) { } else if (response.getStatus() >= 400 && response.getStatus() < 600) {
// 4xx, 5xx response retry delivering events after timeout // 4xx, 5xx response retry delivering events after timeout
setNextBackOff(); setNextBackOff();
setAwaitingRetry(attemptTime, response.getStatus(), response.getStatusInfo().getReasonPhrase()); setAwaitingRetry(attemptTime, response.getStatus(), response.getStatusInfo().getReasonPhrase());

View File

@ -76,7 +76,7 @@ public class GenericWebhookPublisher extends AlertsActionPublisher {
if (response.getStatus() >= 300 && response.getStatus() < 400) { if (response.getStatus() >= 300 && response.getStatus() < 400) {
// 3xx response/redirection is not allowed for callback. Set the webhook state as in error // 3xx response/redirection is not allowed for callback. Set the webhook state as in error
setErrorStatus(attemptTime, response.getStatus(), response.getStatusInfo().getReasonPhrase()); setErrorStatus(attemptTime, response.getStatus(), response.getStatusInfo().getReasonPhrase());
} else if (response.getStatus() >= 300 && response.getStatus() < 600) { } else if (response.getStatus() >= 400 && response.getStatus() < 600) {
// 4xx, 5xx response retry delivering events after timeout // 4xx, 5xx response retry delivering events after timeout
setNextBackOff(); setNextBackOff();
setAwaitingRetry(attemptTime, response.getStatus(), response.getStatusInfo().getReasonPhrase()); setAwaitingRetry(attemptTime, response.getStatus(), response.getStatusInfo().getReasonPhrase());

View File

@ -60,7 +60,7 @@ public class MSTeamsWebhookPublisher extends AlertsActionPublisher {
if (response.getStatus() >= 300 && response.getStatus() < 400) { if (response.getStatus() >= 300 && response.getStatus() < 400) {
// 3xx response/redirection is not allowed for callback. Set the webhook state as in error // 3xx response/redirection is not allowed for callback. Set the webhook state as in error
setErrorStatus(attemptTime, response.getStatus(), response.getStatusInfo().getReasonPhrase()); setErrorStatus(attemptTime, response.getStatus(), response.getStatusInfo().getReasonPhrase());
} else if (response.getStatus() >= 300 && response.getStatus() < 600) { } else if (response.getStatus() >= 400 && response.getStatus() < 600) {
// 4xx, 5xx response retry delivering events after timeout // 4xx, 5xx response retry delivering events after timeout
setNextBackOff(); setNextBackOff();
setAwaitingRetry(attemptTime, response.getStatus(), response.getStatusInfo().getReasonPhrase()); setAwaitingRetry(attemptTime, response.getStatus(), response.getStatusInfo().getReasonPhrase());

View File

@ -61,7 +61,7 @@ public class SlackWebhookEventPublisher extends AlertsActionPublisher {
if (response.getStatus() >= 300 && response.getStatus() < 400) { if (response.getStatus() >= 300 && response.getStatus() < 400) {
// 3xx response/redirection is not allowed for callback. Set the webhook state as in error // 3xx response/redirection is not allowed for callback. Set the webhook state as in error
setErrorStatus(attemptTime, response.getStatus(), response.getStatusInfo().getReasonPhrase()); setErrorStatus(attemptTime, response.getStatus(), response.getStatusInfo().getReasonPhrase());
} else if (response.getStatus() >= 300 && response.getStatus() < 600) { } else if (response.getStatus() >= 400 && response.getStatus() < 600) {
// 4xx, 5xx response retry delivering events after timeout // 4xx, 5xx response retry delivering events after timeout
setNextBackOff(); setNextBackOff();
setAwaitingRetry(attemptTime, response.getStatus(), response.getStatusInfo().getReasonPhrase()); setAwaitingRetry(attemptTime, response.getStatus(), response.getStatusInfo().getReasonPhrase());