Skip to content

Commit

Permalink
Use correct translation placeholder syntax for error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jensschuppe committed Sep 30, 2024
1 parent a28b6b7 commit bd6ec93
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions modules/civiremote_entity/src/CiviCRMPage/CiviCRMPageProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit bd6ec93

Please sign in to comment.