using System; using System.ComponentModel; using System.Runtime.ExceptionServices; namespace JiShe.CollectBus.Common.Extensions { /// /// Extension methods for class. /// public static class ExceptionExtensions { /// /// Uses method to re-throws exception /// while preserving stack trace. /// /// Exception to be re-thrown [Description("重新引发异常")] public static void ReThrow(this Exception exception) { ExceptionDispatchInfo.Capture(exception).Throw(); } } }