Question
Which statement about Exceptions and Custom Errors is the strongest interview answer?
- Exceptions signal that code cannot honestly continue with the current state, and custom errors can give the domain a clearer failure vocabulary.
- Exceptions and Custom Errors is mostly a naming style choice and has little effect on runtime behavior or design tradeoffs.
- Exceptions and Custom Errors exists mainly to reduce the number of files in a Python project.
- Exceptions and Custom Errors matters only for frontend scripting and not for backend or automation code.
Hint
Start with the core rule behind Exceptions and Custom Errors.
Answer and rationale
Correct answer: A. Exceptions signal that code cannot honestly continue with the current state, and custom errors can give the domain a clearer failure vocabulary.
Exceptions signal that code cannot honestly continue with the current state, and custom errors can give the domain a clearer failure vocabulary. This is the base concept interviewers commonly test first.
Track: Python