Home / Report Question

Q. What is the recommended approach for handling exceptions in Ruby?
  • A. Suppress exceptions by using ignore blocks
  • B. Use exit to terminate the program when an exception occurs
  • C. Let exceptions propagate without handling them
  • D. Use begin and rescue blocks to gracefully handle exceptions

Correct Answer: D