public TException ThrowingException()

in src/Microsoft.Azure.Relay/RelayEventSource.cs [305:333]


        public TException ThrowingException<TException>(TException exception, object source = null, EventLevel level = EventLevel.Error, [CallerMemberName] string memberName = "")
            where TException : Exception
        {
            // Avoid converting ToString, etc. if ETW tracing is not enabled.
            if (this.IsEnabled(level, EventKeywords.None))
            {
                var details = PrepareTrace(source);
                string exceptionString = ExceptionToString(exception, details.TrackingContext);
                switch (level)
                {
                    case EventLevel.Critical:
                    case EventLevel.LogAlways:
                    case EventLevel.Error:
                        this.ThrowingExceptionError(details.Source, exceptionString, memberName);
                        break;
                    case EventLevel.Warning:
                        this.ThrowingExceptionWarning(details.Source, exceptionString, memberName);
                        break;
                    case EventLevel.Informational:
                    case EventLevel.Verbose:
                    default:
                        this.ThrowingExceptionInfo(details.Source, exceptionString, memberName);
                        break;
                }
            }

            // This allows "throw ServiceBusEventSource.Log.ThrowingException(..."
            return exception;
        }