Esempio n. 1
0
        public void HandleError(IError error)
        {
            Errors.Add(new DisplayError(error));

            Telemetry.TrackOperation("error", TelemetryResult.Failure, new KeyValuePair <string, object>("code", error.Code));

            PushToErrorList();
        }
Esempio n. 2
0
        public bool HandleErrors(IEnumerable <ILibraryInstallationResult> results)
        {
            IEnumerable <string> json = File.Exists(ConfigFileName) ? File.ReadLines(ConfigFileName) : new string[0];

            foreach (ILibraryInstallationResult result in results)
            {
                if (!result.Success)
                {
                    DisplayError[] displayErrors = result.Errors.Select(error => new DisplayError(error)).ToArray();
                    AddLineAndColumn(json, result.InstallationState, displayErrors);

                    Errors.AddRange(displayErrors);

                    foreach (IError error in result.Errors)
                    {
                        Logger.LogEvent(error.Message, LogLevel.Operation);
                        Telemetry.TrackOperation("error", TelemetryResult.Failure, new KeyValuePair <string, object>("code", error.Code));
                    }
                }
            }

            PushToErrorList();
            return(Errors.Count > 0);
        }