Exception: Coatepec::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/coatepec/errors.rb

Overview

Structured error carrying a stable machine-readable code (and optional details) that MCP tool handlers translate into JSON error responses.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, message = nil, details: {}) ⇒ Error

Returns a new instance of Error.



9
10
11
12
13
# File 'lib/coatepec/errors.rb', line 9

def initialize(code, message = nil, details: {})
  @code = code
  @details = details
  super(message || code.to_s)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



7
8
9
# File 'lib/coatepec/errors.rb', line 7

def code
  @code
end

#detailsObject (readonly)

Returns the value of attribute details.



7
8
9
# File 'lib/coatepec/errors.rb', line 7

def details
  @details
end