Exception: Woods::MCP::BootstrapError

Inherits:
Error
  • Object
show all
Defined in:
lib/woods/mcp/errors.rb

Overview

Base class for all bootstrap-time failures in the MCP server.

Inherits directly from Error — a sibling of ConfigurationError, not a child. Artifact/runtime state errors grouped here do not describe declared-configuration problems, so grouping under ConfigurationError would mislead host apps that rescue it.

Each subclass carries a details hash with structured context for operator messages. The exe/woods-mcp top-level rescue formats this into a one-line hint.

Examples:

Rescue in an MCP entry point

rescue Woods::MCP::BootstrapError => e
  warn "woods-mcp: #{e.class}: #{e.message}"
  exit 2

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of BootstrapError.

Parameters:

  • message (String) (defaults to: nil)
  • details (Hash) (defaults to: {})

    Structured context (artifact paths, versions, etc.)



28
29
30
31
# File 'lib/woods/mcp/errors.rb', line 28

def initialize(message = nil, details: {})
  super(message)
  @details = details
end

Instance Attribute Details

#detailsHash (readonly)

Returns Structured context for operator diagnostics.

Returns:

  • (Hash)

    Structured context for operator diagnostics



24
25
26
# File 'lib/woods/mcp/errors.rb', line 24

def details
  @details
end