Keyword throw
can be used all by itself inside a catch
clause to rethrow whatever exception has been caught by that catch
block. It lets you "plug in" some execution logic in the process of handling the exception without disrupting the details of where the exception has been thrown.
In this case, you are able to log the details to console, and then re-throw the exception as if you never handled it. Note that this is different from catching an exception and wrapping it in your own, because the details of the original exception are preserved.