Пример #1
0
        public Exception CreateDynamicException(ExceptionName name, string message, Exception innerException)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            var dynamicExceptionType = GetDynamicExceptionType(name);

            return((Exception)Activator.CreateInstance(dynamicExceptionType, message, innerException));
        }
Пример #2
0
 public static Exception Create([NotNull] ExceptionName name, [CanBeNull] string message, [CanBeNull] Exception innerException = default)
 {
     return(Factory.CreateDynamicException(name, message, innerException));
 }