Skip to content

Commit 96a94ad

Browse files
committed
Catch exception when attempting to create GitHub installation token
1 parent ceb8752 commit 96a94ad

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

app/cdash/app/Lib/Repository/GitHub.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,12 @@ public function authenticate($required = true)
147147

148148
$this->apiClient->authenticate($jwt, null, GitHubClient::AUTH_JWT);
149149

150-
$token = $this->apiClient->api('apps')->createInstallationToken($this->installationId);
150+
try {
151+
$token = $this->apiClient->api('apps')->createInstallationToken($this->installationId);
152+
} catch (\Exception $e) {
153+
\Log::error($e->getMessage());
154+
return false;
155+
}
151156
if ($token) {
152157
$this->apiClient->authenticate($token['token'], null, GitHubClient::AUTH_HTTP_TOKEN);
153158
}

0 commit comments

Comments
 (0)