Catch all exceptions but log it for later analysis.