add error handling to the command-line arguments parser