Exception: Cattri::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cattri/error.rb

Overview

Base error class for all exceptions raised by Cattri.

All Cattri-specific errors inherit from this class, allowing unified rescue handling at the framework level.

The backtrace is preserved and may be filtered before raising.

Examples:

rescue Cattri::Error => e
  puts "Something went wrong with Cattri: #{e.message}"

Direct Known Subclasses

AttributeError

Instance Method Summary collapse

Constructor Details

#initialize(msg = nil, backtrace = caller) ⇒ Error

Initializes the error with an optional message and caller backtrace.

Parameters:

  • msg (String, nil) (defaults to: nil)

    the error message

  • backtrace (Array<String>) (defaults to: caller)

    optional backtrace (defaults to ‘caller`)



19
20
21
22
# File 'lib/cattri/error.rb', line 19

def initialize(msg = nil, backtrace = caller)
  super(msg)
  set_backtrace(backtrace)
end