LearnFrenzy
Sign in Take a free test

Exception Handling · Exception Handling MCQ · Question 9

What does raise … from do? Answer, explanation & discussion

  • MCQ
  • Hard
  • 0 comments
  • Answer explained
  • Moderated community
Question 9 Back to Exercise

What does raise ConfigError("bad port") from e do?

  • A Raises e instead of ConfigError
  • B Suppresses e completely
  • C Raises ConfigError and stores e as its __cause__, so both appear in the traceback Correct
  • D Raises both exceptions at the same time
Correct Answer: Option C

Chaining keeps the root cause visible while presenting a higher-level error.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links