出现错误时,如何使循环for()
重新启动或跳过?
我的代码在网页上移动,但在不存在的页面上失败,并返回错误并停止。
我尝试了try-catch
,但不了解如何重新启动或跳过。
它应该是一个简单的解决方案。
最佳答案
function A() {
// do something
}
function B() {
try {
// A();
}
catch(Exception e){
log ( e );
A();
}
finally {
// whatever you want whether theres an exception or not
}
}
我不知道这是否可行,但是值得一试。
关于error-handling - for()循环中的错误处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30743106/