Why first case prints : "second level catch" "top level catch"
and second case prints: only "second level catch"?
Difference in finally block.
Future<void> main() async {
try {
secondLevelTryCatch();
} catch (e, s) {
print("top level catch");
}
}
void secondLevelTryCatch() {
try {
throw Exception();
} catch (e, s) {
print("second level catch");
rethrow;
} finally {
//1 no return
//2 return;
}
//3return;
}
why 3 case print: "second level catch" "top level catch"