Exception: WorldMonitor::MCPError

Inherits:
Error
  • Object
show all
Defined in:
lib/worldmonitor.rb

Overview

A JSON-RPC error returned by the MCP server.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, message, data = nil) ⇒ MCPError

Returns a new instance of MCPError.



65
66
67
68
69
70
# File 'lib/worldmonitor.rb', line 65

def initialize(code, message, data = nil)
  @code = code
  @data = data
  hint = code == MCP_AUTH_ERROR_CODE ? " #{AUTH_HINT}" : ""
  super("MCP error #{code}: #{message}#{hint}")
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



63
64
65
# File 'lib/worldmonitor.rb', line 63

def code
  @code
end

#dataObject (readonly)

Returns the value of attribute data.



63
64
65
# File 'lib/worldmonitor.rb', line 63

def data
  @data
end