Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Last updated: Jul 4, 2022

Exceptions and Exception Handling in Ruby

We receive exceptions every now and then, irrespective of the programming language we will be using. These exceptions are sometimes user-defined and sometimes errors. How to handle such exceptions which are errors and how to add exceptions in our program. All these questions will be discussed here.
Exception Classes and Exception Objects in Ruby MEDIUM
The article discusses the Exception Classes and Exception Objects in Ruby followed by its implementation and examples.
Raising Exceptions with "raise" in Ruby
Every Exception in Ruby is built from the built-in Exception class, which has many built-in methods. In this article, we will learn to raise Exceptions with "raise" in Ruby.
Handling exceptions with "rescue" in ruby
In this article, we will be learning about handling exceptions with the help of the rescue keyword in ruby.
The "else" clause helpful in exception handling in ruby
In this article, we will be discussing the “else” clause and how it is useful in exception handling in ruby.
The "ensure" clause helpful in exception handling in ruby
In this article, we will be discussing the “ensure” clause and how it is useful in exception handling in ruby.
Rescue with Methods, Class, and Module Definitions
In this article, we will learn about exception handling and how rescue works with methods, class, and module definitions.
Rescue as Statement Modifier
In this article, we will learn about the rescue clause and its use as a statement modifier and exception handler.