log when catching exception