O'Reilly logo

Ruby Quick Syntax Reference by Matt Clements

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 13

image

Errors and Exceptions

Within Ruby, as well in almost all other object-oriented and procedural-based programming languages, we have the option to throw and handle errors and exceptions within our code. Some of these errors and exceptions we will want to generate ourselves, such as when we have detected some abnormal behavior within the system, whereas other errors and exceptions will be thrown from the Ruby language itself, or other third-party libraries.

For example, we have built a system that allows some text and a photo to be uploaded to an external service (for example, Twitter). We will want to throw our own errors if the user’s ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required