try/except with logging in cli