From bbdea966842b00ae88fe2879b79990bcf679bc6c Mon Sep 17 00:00:00 2001 From: Mike Cote Date: Wed, 30 Dec 2020 10:08:13 -0500 Subject: [PATCH] Rename some variables --- .../actions/server/builtin_action_types/webhook.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/actions/server/builtin_action_types/webhook.ts b/x-pack/plugins/actions/server/builtin_action_types/webhook.ts index 18836660c1e89..089363990643f 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/webhook.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/webhook.ts @@ -177,23 +177,23 @@ export async function executor( if (error.response) { const { - status: statusCode, - statusText: errorText, + status, + statusText, headers: responseHeaders, - data: { message: errorMessage }, + data: { message: responseMessage }, } = error.response; - const errorMessageAsSuffix = errorMessage ? `: ${errorMessage}` : ''; - const message = `[${statusCode}] ${errorText}${errorMessageAsSuffix}`; + const responseMessageAsSuffix = responseMessage ? `: ${responseMessage}` : ''; + const message = `[${status}] ${statusText}${responseMessageAsSuffix}`; logger.error(`error on ${actionId} webhook event: ${message}`); // The request was made and the server responded with a status code // that falls out of the range of 2xx // special handling for 5xx - if (statusCode >= 500) { + if (status >= 500) { return retryResult(actionId, message); } // special handling for rate limiting - if (statusCode === 429) { + if (status === 429) { return pipe( getRetryAfterIntervalFromHeaders(responseHeaders), map((retry) => retryResultSeconds(actionId, message, retry)),