Setting up error handling and logging for the cli.