Exemplo n.º 1
0
        public static void ThrowException()
        {
            var ex = ExceptionGenerator.GenerateException(
                () => ExceptionGenerator.LoopThenException(10, "inner exception test from error api"));

            throw new ErrorReportingApiTestException("error api exception test", ex);
        }
Exemplo n.º 2
0
        public IActionResult Index([FromQuery] bool throwException = false)
        {
            try
            {
                if (throwException)
                {
                    ExceptionGenerator.GenerateException();
                }
                return(Ok());
            }
            catch (Exception ex)
            {
                var wrappingException = new ApplicationException("This is a test exception", ex);

                throw wrappingException;
            }
        }