public static void SendLaunchError(string failureCode, IOSDebugTarget target) { HostTelemetry.SendEvent(Event_LaunchError, new KeyValuePair <string, object>(Property_LaunchErrorResult, failureCode), new KeyValuePair <string, object>(Property_LaunchErrorTarget, target.ToString()) ); }
public static void ReportException(Exception e) { try { HostTelemetry.ReportCurrentException(e, null); Logger.WriteLine("EXCEPTION: " + e.ToString()); } catch { // If anything goes wrong, ignore it. We want to report the original exception, not a telemetry problem } }
public void SendDebuggerAborted(MICommandFactory commandFactory, string lastSentCommandName, /*OPTIONAL*/ string debuggerExitCode) { List <KeyValuePair <string, object> > eventProperties = new List <KeyValuePair <string, object> >(); eventProperties.Add(new KeyValuePair <string, object>(Property_DebuggerName, commandFactory.Name)); eventProperties.Add(new KeyValuePair <string, object>(Property_LastSentCommandName, lastSentCommandName)); if (!string.IsNullOrEmpty(debuggerExitCode)) { eventProperties.Add(new KeyValuePair <string, object>(Property_DebuggerExitCode, debuggerExitCode)); } HostTelemetry.SendEvent(Event_DebuggerAborted, eventProperties.ToArray()); }
public void SendWindowsRuntimeEnvironment(WindowsRuntimeEnvironment environment) { string envValue; if (environment == WindowsRuntimeEnvironment.Cygwin) { envValue = Value_Windows_Runtime_Environment_Cygwin; } else { envValue = Value_Windows_Runtime_Environment_MinGW; } HostTelemetry.SendEvent( Windows_Runtime_Environment, new KeyValuePair <string, object>(Property_Windows_Runtime_Environment, envValue)); }
/// <summary> /// Create a DockerContainerInstance from the results of docker ps in JSON format /// </summary> public static bool TryCreate(string json, out DockerContainerInstance instance) { instance = null; try { JObject obj = JObject.Parse(json); instance = obj.ToObject <DockerContainerInstance>(); } catch (Exception e) { HostTelemetry.SendEvent(TelemetryHelper.Event_DockerPSParseFailure, new KeyValuePair <string, object>[] { new KeyValuePair <string, object>(TelemetryHelper.Property_ExceptionName, e.GetType().Name) }); string error = e.ToString(); VsOutputWindowWrapper.WriteLine(StringResources.Error_DockerPSParseFailed.FormatCurrentCultureWithArgs(json, error), StringResources.Docker_PSName); Debug.Fail(error); } return(instance != null); }
/// <summary> /// Exception filter function used to report exceptions to telemetry. This **ALWAYS** returns 'true'. /// </summary> /// <param name="currentException">The current exception which is about to be caught.</param> /// <param name="logger">For logging messages</param> /// <param name="reportOnlyCorrupting">If true, only corrupting exceptions are reported</param> /// <returns>true</returns> public static bool BeforeCatch(Exception currentException, Logger logger, bool reportOnlyCorrupting) { if (reportOnlyCorrupting && !IsCorruptingException(currentException)) { return(true); // ignore non-corrupting exceptions } try { HostTelemetry.ReportCurrentException(currentException, "Microsoft.MIDebugEngine"); logger?.WriteLine("EXCEPTION: " + currentException.GetType()); logger?.WriteTextBlock("EXCEPTION: ", currentException.StackTrace); } catch { // If anything goes wrong, ignore it. We want to report the original exception, not a telemetry problem } return(true); }
public static void SendLaunchError(string launchErrorTelemetryResult, string targetEngine) { HostTelemetry.SendEvent(Event_LaunchError, new KeyValuePair <string, object>(Property_LaunchErrorResult, launchErrorTelemetryResult), new KeyValuePair <string, object>(Property_LaunchTargetEngine, targetEngine)); }
public static void SendVcRemoteClientError(string failureCode) { HostTelemetry.SendEvent(Event_VcRemoteClientError, new KeyValuePair <string, object>(Property_VcRemoteClientErrorResult, failureCode)); }