replace throw by logging