Write a well-documented program in Python 3.x that takes an integer n (2 <= n <= 10^7) as input and generates a list of all prime numbers up to n using the Sieve of Eratosthenes algorithm. The program should have error handling for invalid input and print the list of prime numbers in ascending order. The code should be optimized for efficiency and readability, adhering to PEP 8 style guidelines with appropriately named variables and functions, comments, and docstrings.
This prompt doesn't seem malicious.