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.
StandardError — default for rescue
- ArgumentError |=> UncaughtThrowError
- IOError | => EOFError
- IndexError | => KeyError, StopIteration
- NameError | => NoMethodError
- RangeError | => FloatDomainError
- RuntimeError — default for raise | => FrozenError
- SystemCallError | => Errno::*
fatal — impossible to rescue