handle exceptions in cli#run