This document contains code snippets and explanations about exceptions and error handling in Ruby. It discusses topics like raising exceptions, rescuing exceptions, the ensure block, built-in exception classes like RuntimeError, and best practices for using exceptions in code.
43. • Use exception when you need
• Wrap exception when re-raising
• Avoid raising during ensure
• Exception is your method interface too
• Classify your exceptions
• Readable exceptional code
• Declare classes for app exception
good points