public static void ProcessException(Exception exception, ITelemetryLogger logger)
        {
            EnsureArg.IsNotNull(logger, nameof(logger));

            var(customException, errorName) = CustomizeException(exception);

            logger.LogError(customException);

            string exceptionName = customException.Equals(exception) ? $"{ErrorType.FHIRServiceError}{errorName}" : customException.GetType().Name;

            _exceptionTelemetryProcessor.LogExceptionMetric(customException, logger, FhirClientMetrics.HandledException(exceptionName, ErrorSeverity.Critical));
        }
示例#2
0
        public static void ProcessException(
            Exception exception,
            ITelemetryLogger logger,
            string errorMetricName = null)
        {
            EnsureArg.IsNotNull(logger, nameof(logger));

            var(customException, errorName) = CustomizeException(exception);

            logger.LogError(customException);

            errorMetricName = customException.Equals(exception) ? errorMetricName ?? $"{ErrorType.EventHubError}{errorName}" : customException.GetType().Name;
            _exceptionTelemetryProcessor.LogExceptionMetric(customException, logger, EventMetrics.HandledException(errorMetricName, ConnectorOperation.Setup));
        }