有没有可能在一个块中重复多个try-catch语句,而不创建另一个(嵌套的) while循环或再次重复整个循环?例如: //try-catch 1: if the user input is correct continue, or ask him to repeat thisinput
//try-catch 2: if the user input is correct continue, or ask him to
下面的foreach循环应该包含一些数组元素检查,如果匿名函数返回false,应用程序应该退出onSubmit,但try-catch块设法在foreach完成之前执行。由于在我的foreach循环中没有任何东西可以真正执行,有没有一种方法可以“等待”直到它完全完成并执行try-catch块中的await代码,同时保持onSubmit方法的异步?something) { }
// This foreach get