private static void OnRollbarInternalEvent(object sender, RollbarEventArgs e) { Console.WriteLine(e.TraceAsString()); RollbarApiErrorEventArgs apiErrorEvent = e as RollbarApiErrorEventArgs; if (apiErrorEvent != null) { //TODO: handle/report Rollbar API communication error event... return; } CommunicationEventArgs commEvent = e as CommunicationEventArgs; if (commEvent != null) { //TODO: handle/report Rollbar API communication event... return; } CommunicationErrorEventArgs commErrorEvent = e as CommunicationErrorEventArgs; if (commErrorEvent != null) { //TODO: handle/report basic communication error while attempting to reach Rollbar API service... return; } InternalErrorEventArgs internalErrorEvent = e as InternalErrorEventArgs; if (internalErrorEvent != null) { //TODO: handle/report basic internal error while using the Rollbar Notifier... return; } }
private void Instance_InternalEvent(object sender, RollbarEventArgs e) { //Console.WriteLine(e.TraceAsString()); RollbarApiErrorEventArgs apiErrorEvent = e as RollbarApiErrorEventArgs; if (apiErrorEvent != null) { _apiErrorsCount++; return; } CommunicationEventArgs commEvent = e as CommunicationEventArgs; if (commEvent != null) { _commSuccessCount++; return; } CommunicationErrorEventArgs commErrorEvent = e as CommunicationErrorEventArgs; if (commErrorEvent != null) { _commErrorsCount++; return; } InternalErrorEventArgs internalErrorEvent = e as InternalErrorEventArgs; if (internalErrorEvent != null) { _internalErrorsCount++; return; } }
private void HandleAgentServerError(object sender, CommunicationErrorEventArgs e) { if (InvokeRequired) { BeginInvoke(new MethodInvoker(() => InsertErrorMessage(e))); } else { InsertErrorMessage(e); } }
private void InsertErrorMessage(CommunicationErrorEventArgs e) { Monitor.Enter(communicationLogLockObject); Color itemBackColor = communicationLogColorListBox.BackColor; Color ItemForeColor = communicationLogColorListBox.ForeColor; ColorListBoxItem item = new ColorListBoxItem(e.DateTime.ToString(DATETIME_FORMAT) + ": " + e.Message, itemBackColor, ItemForeColor); communicationLogColorListBox.Items.Insert(0, item); Monitor.Exit(communicationLogLockObject); }
private void HandleServerError(object sender, CommunicationErrorEventArgs e) { string information = e.DateTime.ToString("yyyyMMdd HHmmss.fff: ") + "[" + e.Originator.ToString() + "]" + e.Message; if (InvokeRequired) { this.Invoke(new MethodInvoker(() => messageListBox.Items.Insert(0, information))); } else { messageListBox.Items.Insert(0, information); } }
/// <summary> /// Handles the InternalEvent event of the Instance control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RollbarEventArgs"/> instance containing the event data.</param> private void Instance_InternalEvent(object sender, RollbarEventArgs e) { string eventTrace = $"##################{Environment.NewLine}{e.TraceAsString()}{Environment.NewLine}"; Console.WriteLine(eventTrace); System.Diagnostics.Trace.WriteLine(eventTrace); CommunicationEventArgs communicationEventArgs = e as CommunicationEventArgs; if (communicationEventArgs != null) { this._rollbarCommEvents.Add(communicationEventArgs); } CommunicationErrorEventArgs communicationErrorEventArgs = e as CommunicationErrorEventArgs; if (communicationErrorEventArgs != null) { this._rollbarCommErrorEvents.Add(communicationErrorEventArgs); } }
private void HandleClientError(object sender, CommunicationErrorEventArgs e) { clientBusy = false; // 20171214 The HandleClientError methods is executed if the // client fails to send the message. }
/// <summary> /// Handles the CommunicationError event of the communicator control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void Communicator_CommunicationError(object sender, CommunicationErrorEventArgs e) { this.OnCommunicationErrorOccurred(this, new PeerCommunicationErrorEventArgs(e.ErrorMessage, true)); }