Objective:
Modify error handling to raise errors when the code encounters issues that prevent it from continuing execution.
Action:
- Update error handling to utilize raise statements for critical errors.
- Identify points in the code where errors lead to an inability to proceed.
- Implement raise statements with descriptive error messages to indicate the nature of the issue.