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 ...