What is the root class for all exceptions in Ruby?The root class for all exceptions in Ruby is <code>Exception</code>. All other exception classes inherit from it.StandardError and Exception in Ruby?<code>StandardError</code> is a subclass of <code>Exception</code> and is the default for rescue clauses. Most common errors inherit from <code>StandardError</code>, while <code>Exception</code> includes system errors that are usually not rescued.StandardError.StandardError are NoMethodError (raised when calling a method that doesn't exist) and ArgumentError (raised when wrong arguments are passed to a method).Exception directly in Ruby?Exception catches all exceptions, including system errors like Interrupt or SystemExit, which can prevent your program from exiting properly. It's safer to rescue StandardError or specific exceptions.What class do syntax errors belong to in Ruby's exception hierarchy?Syntax errors belong to the <code>SyntaxError</code> class, which inherits directly from <code>ScriptError</code>, a subclass of <code>Exception</code>. They are not subclasses of <code>StandardError</code>.Most common exceptions inherit from StandardError, which itself inherits from Exception.
Exception in Ruby?Rescuing Exception catches all exceptions, including system-level ones like Interrupt.
StandardError?SyntaxError inherits from ScriptError, not StandardError.
ArgumentError is raised when wrong arguments are passed to a method.
SyntaxError?SyntaxError inherits directly from ScriptError.
Exception down to common error classes.StandardError instead of Exception in Ruby?