Skip to content

Commit

Permalink
refactor: always return body when running in debug
Browse files Browse the repository at this point in the history
  • Loading branch information
warlof committed Mar 5, 2023
1 parent ce6f707 commit f41f66f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Fetchers/Fetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,12 @@ public function httpRequest(string $method, string $uri, array $headers = [], ar
// Grab the body from the StreamInterface instance.
$content = $response->getBody()->getContents();

if ($log_level == LogLevel::ERROR) {
// For debugging purposes, log the response body
$this->logger->debug('[http ' . $response->getStatusCode() . ', ' . strtolower($response->getReasonPhrase()) . '] ' . $method . ' -> ' . $this->stripRefreshTokenValue($uri), [
'body' => $content,
]);

// For debugging purposes, log the response body
$this->logger->debug('Request for ' . $method . ' -> ' . $uri . ' failed. Response body was: ' .
$content);
if ($log_level == LogLevel::ERROR) {

// Raise the exception that should be handled by the caller
throw new RequestFailedException($this->makeEsiResponse(
Expand Down

0 comments on commit f41f66f

Please sign in to comment.