consistent error handling for CLIs