Ruby Exception Handling: Primer for Dealing with Errors in Ruby

Ruby is a popular open source programming language that is highly flexible and used for everything from basic “hello world" apps to sophisticated, dynamic programs. Whether you’ve been programming in Ruby for years or you’re a complete beginner, tracking down errors in your Ruby app is simple and easy. Let’s go through some basic Ruby error handling, and discover how easy it can be to integrate Rollbar into your Ruby app to automatically log and report your exceptions.
Raise and Rescue Exceptions
Ruby’s default exception handling is to terminate the program in the event of an exception. That’s not really useful when you’re trying to build a complex web application for multiple users. Luckily there’s a way around this – declaring exception handlers. Exception handlers are blocks of code that are called if an exception occurs in the execution of another block of code in your program. For the most basic Ruby exception handling, you need to know how to Raise and Rescue an exception.