From bd6ec9375274b963297f0af2f4bf01a323606dc9 Mon Sep 17 00:00:00 2001 From: Jens Schuppe Date: Mon, 30 Sep 2024 15:29:03 +0200 Subject: [PATCH] Use correct translation placeholder syntax for error messages --- .../src/CiviCRMPage/CiviCRMPageProxy.php | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/modules/civiremote_entity/src/CiviCRMPage/CiviCRMPageProxy.php b/modules/civiremote_entity/src/CiviCRMPage/CiviCRMPageProxy.php index c5669f4..e55ee4d 100644 --- a/modules/civiremote_entity/src/CiviCRMPage/CiviCRMPageProxy.php +++ b/modules/civiremote_entity/src/CiviCRMPage/CiviCRMPageProxy.php @@ -57,7 +57,13 @@ public function get(string $uri): Response { $remoteResponse = $this->client->request('GET', $uri); } catch (GuzzleException $e) { - $this->logger->error(sprintf('Loading "%s" from CiviCRM failed: %s', $uri, $e->getMessage())); + $this->logger->error( + 'Loading "%uri" from CiviCRM failed: %message', + [ + '%uri' => $uri, + '%message' => $e->getMessage(), + ] + ); throw new ServiceUnavailableHttpException(NULL, '', $e, $e->getCode()); } @@ -91,10 +97,14 @@ function () use ($remoteResponse) { ); } - $this->logger->error(sprintf('Unexpected response while loading "%s" from CiviCRM', $uri), [ - 'statusCode' => $remoteResponse->getStatusCode(), - 'reasonPhrase' => $remoteResponse->getReasonPhrase(), - ]); + $this->logger->error( + 'Unexpected response while loading "%uri" from CiviCRM', + [ + '%uri' => $uri, + 'statusCode' => $remoteResponse->getStatusCode(), + 'reasonPhrase' => $remoteResponse->getReasonPhrase(), + ] + ); throw new ServiceUnavailableHttpException(); }