Exception Classes in Ruby

Requires, when you want to rescue them!

It is wise to not rescue a few of subclasses such as SyntaxError, LoadError, and Interrupt.

- Rescuing SignalException prevents the program from responding correctly to signals. You have to kill it manually using kill -9- Rescuing SignalException::Interrupt prevents the user from using CTR + C to exit the program- Rescuing NoMemoryError keeps your program running and it uses up all the RAM in this case also you need to kill it manually using kill -9- Rescuing ScriptError::SyntaxError means that evals fail silently and that behavior is not good for the application or for bug tracing.

NoMemoryError

ScriptError

SecurityError

SignalException

StandardError — default for rescue

SystemExit

SystemStackError

fatal — impossible to rescue

Rubyist!!