I have the following Scala code:
breakable {
someFile.foreach { anotherFile =>
anotherFile.foreach { file =>
try {
val booleanVal = getBoolean(file)
if (booleanVal) break //break out of the try/catch + both loops
} catch {
case e: Throwable => //do something
}
}
}
}
it's the if (booleanVal) break
that doesn't work, because it seems like Scala makes it work as an exception. How do I break out of this nested loop?