From 0dcc99517e4b997efe07980efdec249b23c34542 Mon Sep 17 00:00:00 2001 From: Steve Bjorg Date: Tue, 6 Oct 2020 13:25:46 -0700 Subject: [PATCH] always use Debug.WriteLine() --- .../Websocket/GraphQLHttpWebSocket.cs | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/GraphQL.Client/Websocket/GraphQLHttpWebSocket.cs b/src/GraphQL.Client/Websocket/GraphQLHttpWebSocket.cs index aba35e8f..365c53ad 100644 --- a/src/GraphQL.Client/Websocket/GraphQLHttpWebSocket.cs +++ b/src/GraphQL.Client/Websocket/GraphQLHttpWebSocket.cs @@ -136,6 +136,7 @@ public IObservable> CreateSubscriptionStream( response.MessageBytes); + Debug.WriteLine($"payload => {System.Text.Encoding.UTF8.GetString(response.MessageBytes)}"); o.OnNext(typedResponse.Payload); // in case of a GraphQL error, terminate the sequence after the response has been posted @@ -194,7 +195,7 @@ public IObservable> CreateSubscriptionStream> CreateSubscriptionStream> CreateSubscriptionStream { - Debug.WriteLine($"unwrap exception thread id: {Thread.CurrentThread.ManagedThreadId}"); // if the result contains an exception, throw it on the observable if (t.Item2 != null) + { + Debug.WriteLine($"unwrap exception thread id: {Thread.CurrentThread.ManagedThreadId} => {t.Item2}"); return Observable.Throw>(t.Item2); - - return t.Item1 == null - ? Observable.Empty>() - : Observable.Return(t.Item1); + } + if (t.Item1 == null) + { + Debug.WriteLine($"empty item thread id: {Thread.CurrentThread.ManagedThreadId}"); + return Observable.Empty>(); + } + return Observable.Return(t.Item1); }) // transform to hot observable and auto-connect .Publish().RefCount(); @@ -319,7 +324,7 @@ public Task> SendRequest(GraphQLRequest re } catch (Exception e) { - Console.WriteLine(e); + Debug.WriteLine(e); throw; }