Skip to content
Sharp

Exceptions · interview question

Why wrap an exception with the original cause instead of replacing it completely?

Multiple choiceHardchapter-6-curatedpremiumexceptionscause-chaining-and-error-context
Choose one answer
Answer and explanation

Correct answer

A. To add higher-level context while preserving the technical root cause for debugging

Why

Cause chaining lets higher layers explain what operation failed without erasing the low-level reason. That makes production debugging much easier than replacing the original exception with a vague wrapper.

Test yourself on Exceptions

A free test with instant, explained results. No account needed.

Start free test
All Exceptions questions →