Skip to content
Sharp

Exceptions · interview question

When wrapping exceptions, which practice helps ensure observability?

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

Correct answer

D. Including the original exception as a cause.

Why

Including the original exception as a cause when wrapping exceptions helps maintain observability. It ensures that the full stack trace is available, providing insight into the error's origin.

Test yourself on Exceptions

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

Start free test
All Exceptions questions →