示例#1
0
        private Task ProcessResponse(TrackingDictionary state, object result, HubRequest request, Exception error)
        {
            var    exception    = error.Unwrap();
            string stackTrace   = (exception != null && _isDebuggingEnabled) ? exception.StackTrace : null;
            string errorMessage = exception != null ? exception.Message : null;

            if (exception != null)
            {
                _hubInvocationErrorsTotalCounter.SafeIncrement();
                _hubInvocationErrorsPerSecCounter.SafeIncrement();
                _allErrorsTotalCounter.SafeIncrement();
                _allErrorsPerSecCounter.SafeIncrement();
            }

            var hubResult = new HubResponse
            {
                State      = state.GetChanges(),
                Result     = result,
                Id         = request.Id,
                Error      = errorMessage,
                StackTrace = stackTrace
            };

            return(_transport.Send(hubResult));
        }
示例#2
0
        private Task ProcessResponse(TrackingDictionary state, object result, HubRequest request, Exception error)
        {
            var    exception    = error.Unwrap();
            string stackTrace   = (exception != null && _isDebuggingEnabled) ? exception.StackTrace : null;
            string errorMessage = exception != null ? exception.Message : null;

            var hubResult = new HubResponse
            {
                State      = state.GetChanges(),
                Result     = result,
                Id         = request.Id,
                Error      = errorMessage,
                StackTrace = stackTrace
            };

            return(_transport.Send(hubResult));
        }