Catching Throwable (rather than Exception) so that AssertionErrors are also logged.