Vidyalelo
Ruby Programming · Q41

Best Practices and Code Conventions in Ruby

Programming · Ruby Programming · question 41

Q41

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
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board