Exception: Coatepec::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Coatepec::Error
- 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
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
Instance Method Summary collapse
-
#initialize(code, message = nil, details: {}) ⇒ Error
constructor
A new instance of Error.
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, = nil, details: {}) @code = code @details = details super( || code.to_s) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
7 8 9 |
# File 'lib/coatepec/errors.rb', line 7 def code @code end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
7 8 9 |
# File 'lib/coatepec/errors.rb', line 7 def details @details end |