Change the logging of caught exception