Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/SchemaLoader/GithubSchemaLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@ private function fetchDirectoryContents(
$response = $this->httpClient->sendRequest($request);
} catch (ClientExceptionInterface $e) {
throw new SchemaLoaderException(
\sprintf('GitHub API request failed for "%s": %s', $apiUrl, $e->getMessage()),
\sprintf(
'GitHub API request failed for "%s" (%s): %s',
$apiUrl,
$token !== null && $token !== '' ? 'with authentication' : 'without authentication',
$e->getMessage()
),
previous: $e
);
}
Expand Down Expand Up @@ -169,7 +174,12 @@ private function fetchFileContent(string $url, ?string $token): string
$response = $this->httpClient->sendRequest($request);
} catch (ClientExceptionInterface $e) {
throw new SchemaLoaderException(
\sprintf('Failed to fetch file from "%s": %s', $url, $e->getMessage()),
\sprintf(
'Failed to fetch file from "%s" (%s): %s',
$url,
$token !== null && $token !== '' ? 'with authentication' : 'without authentication',
$e->getMessage(),
),
previous: $e
);
}
Expand Down