public static void SendError(RaygunClient client, Exception e, StoredMessage storedMessage) { var extraData = StoredMessageToDictionary(storedMessage); AddServiceControlVersion(extraData); client.SendInBackground(e, null, extraData); }
public ExceptionDetails(StoredMessage message) { ExceptionType = message.GetHeaderByKey(MessageHeaderKeys.ExceptionType); Message = message.GetHeaderByKey(MessageHeaderKeys.ExceptionMessage); Source = message.GetHeaderByKey(MessageHeaderKeys.ExceptionSource); StackTrace = message.GetHeaderByKey(MessageHeaderKeys.ExceptionStackTrace); }
public void Display(StoredMessage selectedMessage) { if (SelectedMessage == selectedMessage) //Workaround, to force refresh the property. Should refactor to use the same approach as hex viewer. { OnSelectedMessageChanged(); } else { SelectedMessage = selectedMessage; } }
public void Should_not_throw_when_message_has_preamble_header() { ((IViewAware)viewModel).AttachView(view); //Activetes the view var messageBodyWithBOM = Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble()) + TestMessage; var message = new StoredMessage { Body = new PresentationBody { Text = messageBodyWithBOM } }; Should.NotThrow(() => viewModel.Display(message)); view.Received().Display(Arg.Is(messageBodyWithBOM)); }
public MessageTreeNode(StoredMessage msg) { Message = msg; Parent = msg.GetHeaderByKey(MessageHeaderKeys.RelatedTo, null); }
Arrow CreateArrow(StoredMessage message) { var arrow = new Arrow(message, container) { Name = TypeHumanizer.ToName(message.MessageType) }; if (message.MessageIntent == MessageIntent.Publish) { arrow.Type = ArrowType.Event; } else { var isTimeoutString = message.GetHeaderByKey(MessageHeaderKeys.IsSagaTimeout); var isTimeout = !string.IsNullOrEmpty(isTimeoutString) && bool.Parse(isTimeoutString); if (isTimeout) { arrow.Type = ArrowType.Timeout; } else if (Equals(message.ReceivingEndpoint, message.SendingEndpoint)) { arrow.Type = ArrowType.Local; } else { arrow.Type = ArrowType.Command; } } return arrow; }
void UpdateProcessingHandler(Handler processingHandler, StoredMessage message, EndpointItem processingEndpoint) { processingHandler.ProcessedAt = message.ProcessedAt; processingHandler.ProcessingTime = message.ProcessingTime; processingHandler.Name = TypeHumanizer.ToName(message.MessageType); if (message.InvokedSagas != null && message.InvokedSagas.Count > 0) { processingHandler.PartOfSaga = string.Join(", ", Array.ConvertAll(message.InvokedSagas.ToArray(), x => TypeHumanizer.ToName(x.SagaType))); } if (message.Status == MessageStatus.ArchivedFailure || message.Status == MessageStatus.Failed || message.Status == MessageStatus.RepeatedFailure) { processingHandler.State = HandlerState.Fail; } else { processingHandler.State = HandlerState.Success; } }
Handler CreateProcessingHandler(StoredMessage message, EndpointItem processingEndpoint) { var handler = new Handler(message.MessageId, container) { Endpoint = processingEndpoint }; UpdateProcessingHandler(handler, message, processingEndpoint); return handler; }
public bool DisplayPropertiesChanged(StoredMessage focusedMessage) => (focusedMessage == null) || (Status != focusedMessage.Status) || (TimeSent != focusedMessage.TimeSent) || (ProcessingTime != focusedMessage.ProcessingTime) || (ReceivingEndpoint != focusedMessage.ReceivingEndpoint) || (SendingEndpoint != focusedMessage.SendingEndpoint);
static EndpointItem CreateSendingEndpoint(StoredMessage m) => new EndpointItem(m.SendingEndpoint.Name, m.SendingEndpoint.Host, m.SendingEndpoint.HostId, m.GetHeaderByKey(MessageHeaderKeys.Version, null));
static EndpointItem CreateProcessingEndpoint(StoredMessage m) => new EndpointItem(m.ReceivingEndpoint.Name, m.ReceivingEndpoint.Host, m.ReceivingEndpoint.HostId, m.SendingEndpoint.Equals(m.ReceivingEndpoint) ? m.GetHeaderByKey(MessageHeaderKeys.Version, null) : null);
public ScrollDiagramItemIntoView(StoredMessage message) { Message = message; }
static IDictionary StoredMessageToDictionary(StoredMessage storedMessage) => storedMessage.Headers.ToDictionary(h => h.Key, h => h.Value);
public ReportMessagePackage(Exception ex, StoredMessage message) { Exception = ex; Message = message; }
Handler CreateSendingHandler(StoredMessage message, EndpointItem sendingEndpoint) { var handler = new Handler(message.GetHeaderByKey(MessageHeaderKeys.RelatedTo, ConversationStartHandlerName), container) { State = HandlerState.Success, Endpoint = sendingEndpoint }; return handler; }
public void Display(StoredMessage selectedMessage) { SelectedMessage = selectedMessage; }