From f38870d176a153581e0459d5c2e749023f13ae5e Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 20 Nov 2024 02:55:45 +1100 Subject: [PATCH] [8.x] Swaps template literals for sprintf style interpolation (#200634) (#200737) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Backport This will backport the following commits from `main` to `8.x`: - [Swaps template literals for sprintf style interpolation (#200634)](https://github.com/elastic/kibana/pull/200634) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Jason Rhodes --- .../synthetics/public/utils/api_service/api_service.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/observability_solution/synthetics/public/utils/api_service/api_service.ts b/x-pack/plugins/observability_solution/synthetics/public/utils/api_service/api_service.ts index 58c1d88226e5e..d16e34b430f1c 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/utils/api_service/api_service.ts +++ b/x-pack/plugins/observability_solution/synthetics/public/utils/api_service/api_service.ts @@ -54,11 +54,15 @@ class ApiService { if (isRight(decoded)) { return decoded.right as T; } else { + // This was changed from using template literals to using %s string + // interpolation, but the previous version included the apiUrl value + // twice. To ensure the log output doesn't change, this continues. + // // eslint-disable-next-line no-console console.error( - `API ${apiUrl} is not returning expected response, ${formatErrors( - decoded.left - )} for response`, + 'API %s is not returning expected response, %s for response', + apiUrl, + formatErrors(decoded.left).toString(), apiUrl, response );