Beispiel #1
0
        private void ReportNonFatalWatson(Exception exception)
        {
            s_debuggingLastDisconnectReason    = _debuggingLastDisconnectReason;
            s_debuggingLastDisconnectCallstack = _debuggingLastDisconnectCallstack;

            FatalError.ReportWithoutCrash(exception);
        }
Beispiel #2
0
        private void ReportNonFatalWatson(Exception ex, string message)
        {
            s_debuggingLastDisconnectReason    = _debuggingLastDisconnectReason;
            s_debuggingLastDisconnectCallstack = _debuggingLastDisconnectCallstack;

            ReportNonFatalWatsonWithServiceHubLogs(ex, message);
        }
Beispiel #3
0
        private void OnDisconnected(object sender, JsonRpcDisconnectedEventArgs e)
        {
            _debuggingLastDisconnectReason    = e;
            _debuggingLastDisconnectCallstack = new StackTrace().ToString();

            // tell we got disconnected
            Disconnected(e);
        }
Beispiel #4
0
        protected void LogDisconnectInfo(JsonRpcDisconnectedEventArgs?e, string?callstack)
        {
            if (e != null)
            {
                LogError($"disconnect exception: {e.Description}, {e.Reason}, {e.LastMessage}, {e.Exception?.ToString()}");
            }

            if (callstack != null)
            {
                LogError($"disconnect callstack: {callstack}");
            }
        }
Beispiel #5
0
        private void OnDisconnected(object sender, JsonRpcDisconnectedEventArgs e)
        {
            _debuggingLastDisconnectReason    = e;
            _debuggingLastDisconnectCallstack = new StackTrace().ToString();

            // Don't log info in cases that are common - such as if we dispose the connection or the remote host process shuts down.
            if (e.Reason != DisconnectedReason.LocallyDisposed &&
                e.Reason != DisconnectedReason.RemotePartyTerminated)
            {
                LogDisconnectInfo(e, _debuggingLastDisconnectCallstack);
            }

            Disconnected?.Invoke(e);
        }
Beispiel #6
0
        private void LogDisconnectInfo(JsonRpcDisconnectedEventArgs?e, string?callstack)
        {
            if (e != null)
            {
                LogError($@"Stream disconnected unexpectedly: 
Description: {e.Description}
Reason: {e.Reason}
LastMessage: {e.LastMessage}
Exception: {e.Exception?.ToString()}");
            }

            if (callstack != null)
            {
                LogError($"disconnect callstack: {callstack}");
            }
        }
Beispiel #7
0
        private bool ReportUnlessCanceled(Exception ex, CancellationToken cancellationToken)
        {
            if (cancellationToken.IsCancellationRequested)
            {
                return(true);
            }

            s_debuggingLastDisconnectReason    = _debuggingLastDisconnectReason;
            s_debuggingLastDisconnectCallstack = _debuggingLastDisconnectCallstack;

            // send NFW to figure out why this is happening
            ex.ReportServiceHubNFW("RemoteHost Failed");

            GC.KeepAlive(_debuggingLastDisconnectReason);
            GC.KeepAlive(_debuggingLastDisconnectCallstack);

            // we return true here to catch all exceptions from servicehub.
            // we record them in NFW and convert that to our soft crash exception.
            return(true);
        }