From d627e9e1b0f63969ce3f6a689a0b2d3d0b556c4c Mon Sep 17 00:00:00 2001 From: Djuradj Kurepa <91743470+dkurepa@users.noreply.github.com> Date: Mon, 30 Dec 2024 14:46:34 +0100 Subject: [PATCH] Add exception logging to GetPullRequestStatus (#4281) --- .../PullRequestUpdater.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ProductConstructionService/ProductConstructionService.DependencyFlow/PullRequestUpdater.cs b/src/ProductConstructionService/ProductConstructionService.DependencyFlow/PullRequestUpdater.cs index 106a9ce078..17492f9a73 100644 --- a/src/ProductConstructionService/ProductConstructionService.DependencyFlow/PullRequestUpdater.cs +++ b/src/ProductConstructionService/ProductConstructionService.DependencyFlow/PullRequestUpdater.cs @@ -233,7 +233,16 @@ protected virtual Task TagSourceRepositoryGitHubContactsIfPossibleAsync(InProgre (var targetRepository, _) = await GetTargetAsync(); IRemote remote = await _remoteFactory.CreateRemoteAsync(targetRepository); - PrStatus status = await remote.GetPullRequestStatusAsync(pr.Url); + PrStatus status; + try + { + status = await remote.GetPullRequestStatusAsync(pr.Url); + } + catch (Exception) + { + _logger.LogError($"Couldn't get status of PR {pr.Url}"); + throw; + } _logger.LogInformation("Pull request {url} is {status}", pr.Url, status); switch (status)