Skip to content

Commit

Permalink
Don't throw exceptions if LexBox is unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
rmunn committed Aug 21, 2024
1 parent 129aaa2 commit a5b5449
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/LfMerge.Core.Tests/SRTestEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ public async Task LoginAs(string lexboxUsername, string lexboxPassword)

public async Task<bool> IsLexBoxAvailable()
{
var httpResponse = await Http.GetAsync(new Uri(LexboxUrl, "api/healthz"));
return httpResponse.IsSuccessStatusCode && httpResponse.Headers.TryGetValues("lexbox-version", out var _ignore);
try {
var httpResponse = await Http.GetAsync(new Uri(LexboxUrl, "api/healthz"));
return httpResponse.IsSuccessStatusCode && httpResponse.Headers.TryGetValues("lexbox-version", out var _ignore);
} catch { return false; }
}

public static Uri LexboxUrlForProject(string code) => new Uri(LexboxUrl, $"hg/{code}");
Expand Down

0 comments on commit a5b5449

Please sign in to comment.