Пример #1
0
        private void DeserializeAndSendEvent(string line)
        {
            try
            {
                var kernelEventEnvelope = KernelEventEnvelope.Deserialize(line);
                _kernelEvents.OnNext(kernelEventEnvelope.Event);
            }
            catch (JsonReaderException ex)
            {
                var diagnosticEvent = new DiagnosticLogEntryProduced(
                    $"Error while parsing command: {ex.Message}\n{line}");

                _kernelEvents.OnNext(diagnosticEvent);
            }
        }
Пример #2
0
        private void DeserializeAndSendEvent(string line)
        {
            IKernelEventEnvelope kernelEventEnvelope = null;

            try
            {
                kernelEventEnvelope = KernelEventEnvelope.Deserialize(line);
            }
            catch (Exception ex)
            {
                var diagnosticEvent = new DiagnosticLogEntryProduced(
                    $"Error while parsing command: {ex.Message}\n{line}", KernelCommand.None);

                _kernelEvents.OnNext(diagnosticEvent);
            }

            if (kernelEventEnvelope is not null)
            {
                _kernelEvents.OnNext(kernelEventEnvelope.Event);
            }
        }