In the first snippet, "all done" will be printed regardless of whether the catch
block was successful.
In the second snippet, "all done" will not be printed if the catch
block was unsuccessful.
Both your examples show a trivial catch
block, containing a simple echo
. Consider what would happen if the catch
block contained a task that might actually fail...