Class: McpToolkit::Gateway::Client::Error

Inherits:
Error
  • Object
show all
Defined in:
lib/mcp_toolkit/gateway/client.rb

Overview

Raised for any upstream failure. jsonrpc_error carries an upstream JSON-RPC error hash when the failure was a protocol-level error response, so a proxy can relay it verbatim; nil for transport/HTTP failures. http_status carries the HTTP status for a non-2xx response (nil otherwise), so callers can distinguish a session-loss 404 from other failures. This class references NO transport/protocol-error type — the consumer maps it.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, jsonrpc_error: nil, http_status: nil) ⇒ Error

Returns a new instance of Error.



59
60
61
62
63
# File 'lib/mcp_toolkit/gateway/client.rb', line 59

def initialize(message, jsonrpc_error: nil, http_status: nil)
  super(message)
  @jsonrpc_error = jsonrpc_error
  @http_status = http_status
end

Instance Attribute Details

#http_statusObject (readonly)

Returns the value of attribute http_status.



57
58
59
# File 'lib/mcp_toolkit/gateway/client.rb', line 57

def http_status
  @http_status
end

#jsonrpc_errorObject (readonly)

Returns the value of attribute jsonrpc_error.



57
58
59
# File 'lib/mcp_toolkit/gateway/client.rb', line 57

def jsonrpc_error
  @jsonrpc_error
end