Exception: Castkit::Error

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

Overview

Base error class for all Castkit-related exceptions.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, context: nil) ⇒ Error

Initializes a Castkit error.

Parameters:

  • msg (String)

    the error message

  • context (Object, String, nil) (defaults to: nil)

    optional data object or hash for context



13
14
15
16
# File 'lib/castkit/error.rb', line 13

def initialize(msg, context: nil)
  super(msg)
  @context = context
end

Instance Attribute Details

#contextHash, ... (readonly)

Returns contextual data to aid in debugging.

Returns:

  • (Hash, Object, nil)

    contextual data to aid in debugging



7
8
9
# File 'lib/castkit/error.rb', line 7

def context
  @context
end