Ejemplo n.º 1
0
        /// <summary>
        /// Handles the specified arguments.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public void Handle(OperationErrorEvent args)
        {
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }

            Console.WriteLine(Resources.LoadingErrorMessageFormat, args.Operation.Source.Name, args.Exception.Message);

            foreach (var property in args.Properties)
            {
                Console.WriteLine(Resources.NameValuePairFormat, property.Key, property.Value);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles the specified arguments.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public void Handle(OperationErrorEvent args)
        {
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }

            var properties = new Dictionary <string, string>(args.Properties);

            properties["OperationId"] = args.Operation.OperationId.ToString();
            properties["Source"]      = args.Operation.Source.Name;
            properties["Connection"]  = args.Operation.Source.ConnectionName;
            properties["Target"]      = args.Operation.Target.Name;

            this.telemetry.LogException(args.Exception, properties, NoMetrics);
            this.telemetry.TrackEvent("Operation Error", properties, NoMetrics);
        }