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); }
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; } }