Exception: LLM::MCP::Error
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Attributes inherited from Error
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message, code = nil, data = nil) ⇒ Error
constructor
A new instance of Error.
Methods inherited from Error
Constructor Details
#initialize(message, code = nil, data = nil) ⇒ Error
Returns a new instance of Error.
23 24 25 26 27 |
# File 'lib/llm/mcp/error.rb', line 23 def initialize(, code = nil, data = nil) super() @code = code @data = data end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
5 6 7 |
# File 'lib/llm/mcp/error.rb', line 5 def code @code end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/llm/mcp/error.rb', line 5 def data @data end |
Class Method Details
.from(response:) ⇒ LLM::MCP::Error
11 12 13 14 |
# File 'lib/llm/mcp/error.rb', line 11 def self.from(response:) error = response.fetch("error") new(*error.values_at("message", "code", "data")) end |