Systematically catch and log uncaught exceptions