0Pricing
Ruby Academy · Lesson

Raising and Customizing Exceptions

Learn how to create and raise custom error messages to improve debugging.

1

Raising and Customizing Exceptions

Sometimes, you need to manually raise errors in your Ruby programs.

In this lesson, you will learn how to raise and customize exceptions to improve debugging.

Raising and Customizing Exceptions — illustration 1

2

Using raise

The raise keyword generates an exception.

raise 'Something went wrong!'

All lessons in this course

  1. Handling Errors with begin and rescue
  2. Raising and Customizing Exceptions
  3. Debugging Techniques
← Back to Ruby Academy