🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Error Handling and Debugging: all 10 questions

Quiz: Error Handling and Debugging · Question 6 of 10

In a catch block, you get an error your code does not know how to handle. What should you do?

In a catch block, you get an error your code does not know how to handle. What should you do?

  1. A.Ignore it silently
  2. B.Re-throw it so a higher level can handle or report it
  3. C.Reload the page
  4. D.Convert it to a string and return it
Answer & explanation

Correct answer: Re-throw it so a higher level can handle or report it

Swallowing unknown errors hides real bugs.

Can you get the rest right without peeking?

Take the timed Quiz: Error Handling and Debugging quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →