Exceptional Exception Handlers
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigddBpRYGiWGR0bcSQjQ4s1wLohjJEcrV5d2R7mvGgORu5btBzXO2cmN24zoV7oOJRB_Sa28ce7aTpYoutywsa54nt6zZod7wHRwhjIA2C7WxJPNo7ifpNZuRaFHxKFEVJ2GxuWa3bDTs3/s400/9.png)
As a budding developer, I quickly discovered that there's nothing quite as satisfying as debugging a frustrating error after hacking away at it for what seems to be an eternity. But sometimes error messages aren't very clear and it can make the debugging process especially difficult. Enter exception handlers ! Before we dive into just what an exception handler is and does, we need to take a look at a key question - what is an error and how are errors raised? In Ruby, an error is an instance of the predefined class Exception that is raised (or thrown) when something has gone wrong. By default, Ruby programs terminate when an exception occurs, unless you have an exception handler - a block of code that is executed when an exception occurs. To handle exceptions, we can enclose the code that could throw an exception in a begin-end block and use one or more rescue clauses to tell Ruby the types of exceptions to handle. Note that the body of a method d