Skip to content

Commit

Permalink
Improve firebase error visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Paymon Khamooshi committed Feb 12, 2024
1 parent 3aaa54a commit ad58395
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SharedApp/Network.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static HttpClient HttpClient(string domainIpOrUrl, TimeSpan timeout)

static HttpClient CreateHttpClient(string hostName, TimeSpan timeout, string scheme = "http", int port = 80)
{
if (hostName.ContainsAny(new[] { "/", ":" })) throw new Exception($"Invalid host name format: {hostName}");
if (hostName.ContainsAny(new[] { "/", ":" })) throw new HttpRequestException($"Invalid host name format: {hostName}");

var client = Context.Current.GetService<IHttpClientFactory>().CreateClient("default");

Expand Down Expand Up @@ -158,7 +158,7 @@ static async void TryDownload(Uri url, int retries, int timeoutPerAttempt, TaskC

if (data is null)
{
error ??= new Exception(retries + " attempts to download a URL all failed: " + url);
error ??= new HttpRequestException(retries + " attempts to download a URL all failed: " + url);
source.TrySetException(error);
}
else source.TrySetResult(data);
Expand Down

0 comments on commit ad58395

Please sign in to comment.