1
The nodejs version is: V8.10.0
I don’t know much about Ode. In this specific case I need the next iteration to be executed only after the previous iteration has been completed. Also, I need that when an exception occurs, the is be stopped and no more iteration happens.
I thought using break
would solve my problem to interrupt the for but did not work.
Note: I really need to do this in version 8, in version 11 I did without problems. But in this version I’m having difficulties.
for (let i = 0; i < modelMatchesList.length; i++) {
if (someVar) {
DB.query("example(?,?)", [foo, bar])
.then((result) => {
doSomething(result);
})
.then(() => {
doSomething();
})
.catch((e) => {
// Caso tenha alguma excpetion
// Parar e sair do for
})
}
}