Skip to content

Commit f052f03

Browse files
committed
Properly re-throw MakeServiceRequest's exceptions
1 parent 4eacd0f commit f052f03

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

libsignal-service-dotnet/push/PushServiceSocket.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,16 @@ private byte[] UploadAttachment(string method, string url, Stream data, long dat
614614

615615
private string MakeServiceRequest(string urlFragment, string method, string body)
616616
{
617-
return MakeServiceRequestAsync(urlFragment, method, body).Result;
617+
try
618+
{
619+
return MakeServiceRequestAsync(urlFragment, method, body).Result;
620+
}
621+
catch (AggregateException e)
622+
{
623+
throw e.InnerException;
624+
}
618625
}
626+
619627
private async Task<string> MakeServiceRequestAsync(string urlFragment, string method, string body)
620628
//throws NonSuccessfulResponseCodeException, PushNetworkException
621629
{
@@ -628,7 +636,6 @@ private async Task<string> MakeServiceRequestAsync(string urlFragment, string me
628636
{
629637
responseCode = connection.StatusCode;
630638
responseMessage = connection.ReasonPhrase;
631-
Debug.WriteLine(SynchronizationContext.Current);
632639
responseBody = await connection.Content.ReadAsStringAsync();
633640
}
634641
catch (Exception ioe)

0 commit comments

Comments
 (0)