From e679af850ac708ed4f317063aebe7322b3e897ee Mon Sep 17 00:00:00 2001 From: varshit97plivo Date: Tue, 21 Jun 2022 12:32:17 +0530 Subject: [PATCH 1/2] add logs --- src/Plivo/Client/SystemHttpClient.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Plivo/Client/SystemHttpClient.cs b/src/Plivo/Client/SystemHttpClient.cs index 602d9b4b..e5e5d343 100755 --- a/src/Plivo/Client/SystemHttpClient.cs +++ b/src/Plivo/Client/SystemHttpClient.cs @@ -274,13 +274,19 @@ public async Task> SendRequest(string method, string uri, Di } else if (isVoiceRequest) { + Console.WriteLine("Is a voice request"); response = await _voiceBaseUriClient.SendAsync(request).ConfigureAwait(false); + Console.WriteLine("First request {0}", response); if ((int)response.StatusCode >= 500) { request = NewRequestFunc(method, uri, data, filesToUpload); + Console.WriteLine("First request failed. Making second request. Retrying on {0}", request); response = await _voiceFallback1Client.SendAsync(request).ConfigureAwait(false); + Console.WriteLine("Second request {0}", response); if ((int)response.StatusCode >= 500) { request = NewRequestFunc(method, uri, data, filesToUpload); + Console.WriteLine("Second request failed. Making third request. Retrying on {0}", request); response = await _voiceFallback2Client.SendAsync(request).ConfigureAwait(false); + Console.WriteLine("Third request {0}", response); } } } From 77b2b80aa34b4533163d1818b9ad30cacfe7ca90 Mon Sep 17 00:00:00 2001 From: varshit97plivo Date: Tue, 21 Jun 2022 14:54:38 +0530 Subject: [PATCH 2/2] print exception --- src/Plivo/Resource/ResourceInterface.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plivo/Resource/ResourceInterface.cs b/src/Plivo/Resource/ResourceInterface.cs index 1f32aa8a..a18936b4 100755 --- a/src/Plivo/Resource/ResourceInterface.cs +++ b/src/Plivo/Resource/ResourceInterface.cs @@ -256,7 +256,7 @@ public static T ExecuteWithExceptionUnwrap (Func func) where T : class { } catch (AggregateException ex) { ex.Flatten (); if (ex.InnerExceptions[0] is Newtonsoft.Json.JsonReaderException){ - throw new PlivoValidationException ("Unexpected error occured. Please contact plivo support"); + throw new PlivoValidationException ("Unexpected error occured. Please contact plivo support. Exception is" + ex.ToString()); } throw ex.InnerExceptions[0];