Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 6df00c6

Browse files
committed
Use Forget to log any exceptions
1 parent 341877c commit 6df00c6

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

src/GitHub.InlineReviews/Services/PullRequestStatusBarManager.cs

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void StartShowingStatus()
7272
.CombineLatest(sessions, (r, s) => (r, s))
7373
.Throttle(TimeSpan.FromSeconds(1))
7474
.ObserveOn(RxApp.MainThreadScheduler)
75-
.Subscribe(x => RefreshCurrentSession(x.r, x.s).Forget());
75+
.Subscribe(x => RefreshCurrentSession(x.r, x.s).Forget(log));
7676
}
7777
catch (Exception e)
7878
{
@@ -82,22 +82,15 @@ public void StartShowingStatus()
8282

8383
async Task RefreshCurrentSession(ILocalRepositoryModel repository, IPullRequestSession session)
8484
{
85-
try
86-
{
87-
var showStatus = await IsDotComOrEnterpriseRepository(repository);
88-
if (!showStatus)
89-
{
90-
ShowStatus(null);
91-
return;
92-
}
93-
94-
var viewModel = CreatePullRequestStatusViewModel(session);
95-
ShowStatus(viewModel);
96-
}
97-
catch (Exception e)
85+
var showStatus = await IsDotComOrEnterpriseRepository(repository);
86+
if (!showStatus)
9887
{
99-
log.Error(e, nameof(RefreshCurrentSession));
88+
ShowStatus(null);
89+
return;
10090
}
91+
92+
var viewModel = CreatePullRequestStatusViewModel(session);
93+
ShowStatus(viewModel);
10194
}
10295

10396
async Task<bool> IsDotComOrEnterpriseRepository(ILocalRepositoryModel repository)

0 commit comments

Comments
 (0)