{"record":{"id":"eff5b7f47c8e5f9b","repo":"FujiwaraChoki/MoneyPrinterV2","slug":"empty-input-is-not-allowed","errorCode":null,"errorMessage":"Empty input is not allowed.","messagePattern":"Empty input is not allowed\\.","errorType":"console","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"src/main.py","lineNumber":59,"sourceCode":"    Returns:\n        None\"\"\"\n\n    # Get user input\n    # user_input = int(question(\"Select an option: \"))\n    valid_input = False\n    while not valid_input:\n        try:\n    # Show user options\n            info(\"\\n============ OPTIONS ============\", False)\n\n            for idx, option in enumerate(OPTIONS):\n                print(colored(f\" {idx + 1}. {option}\", \"cyan\"))\n\n            info(\"=================================\\n\", False)\n            user_input = input(\"Select an option: \").strip()\n            if user_input == '':\n                print(\"\\n\" * 100)\n                raise ValueError(\"Empty input is not allowed.\")\n            user_input = int(user_input)\n            valid_input = True\n        except ValueError as e:\n            print(\"\\n\" * 100)\n            print(f\"Invalid input: {e}\")\n\n\n    # Start the selected option\n    if user_input == 1:\n        info(\"Starting YT Shorts Automater...\")\n\n        cached_accounts = get_accounts(\"youtube\")\n\n        if len(cached_accounts) == 0:\n            warning(\"No accounts found in cache. Create one now?\")\n            user_input = question(\"Yes/No: \")\n\n            if user_input.lower() == \"yes\":","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/FujiwaraChoki/MoneyPrinterV2/blob/5192af8eca97759f941834b947e3ceb209da0649/src/main.py#L41-L77","documentation":"ValueError raised by the main menu loop when input() returns an empty (whitespace-stripped) string. It is immediately caught by the surrounding `except ValueError`, printing 'Invalid input: Empty input is not allowed.', clearing the screen, and re-prompting — a control-flow error, not a crash.","triggerScenarios":"Running src/main.py and pressing ENTER at the 'Select an option:' prompt without typing a number; also triggered by any non-numeric input via int(user_input) raising ValueError.","commonSituations":"User hitting ENTER accidentally, piping empty lines into the CLI, or automated invocation of main.py without stdin input.","solutions":["Simply re-enter a valid numeric option at the prompt","If scripting, feed a valid choice via stdin: `echo 1 | python3 src/main.py`","Add a default option or reprompt without stack noise if desired"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"user_input = input(\"Select an option: \").strip()\nif not user_input.isdigit():\n    print(\"Please enter a number\"); continue","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate before int() conversion","Provide a default option for ENTER","When scripting, pipe a valid numeric choice into stdin"],"tags":["cli","user-input","menu","validation"],"backgroundTag":"empty-user-input","analyzedSha":"5192af8eca97759f941834b947e3ceb209da0649","analyzedAt":"2026-08-28T10:31:46.474Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}