Skip to content
Sharp

Exceptions · interview question

A repository catches SQLException. What is the strongest reason to do that?

Multiple choiceEasychapter-6-curatedpremiumexceptionscode-reading-with-exceptions
Choose one answer
Answer and explanation

Correct answer

D. To translate a low-level failure into a clearer persistence or domain exception with context

Why

Lower layers often catch technical exceptions so they can translate them into clearer application-specific failures. If a repository can add order IDs or persistence meaning, that catch is architectural, not decorative.

Test yourself on Exceptions

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

Start free test
All Exceptions questions →