Simplying exception catch and logging it.