Exception: Woods::MCP::ProviderUnreachable
- Defined in:
- lib/woods/mcp/errors.rb
Overview
Raised when the configured embedding provider cannot be reached at boot. This is a recoverable sibling of BootstrapError — it is deliberately outside the BootstrapError hierarchy because the MCP server starts degraded and retries on first query rather than refusing to start.
Bootstrapper catches this internally; nothing upstream should rescue it.
Instance Attribute Summary collapse
-
#details ⇒ Hash
readonly
Structured context forwarded to operators for diagnosis.
-
#reason ⇒ String
readonly
Machine-readable failure reason (e.g. “connection_refused”, “timeout”, “http_500”, “unauthorized”, “dns_failure”).
-
#url ⇒ String
readonly
URL that was probed.
Instance Method Summary collapse
-
#initialize(message = nil, url: nil, reason: nil, details: {}) ⇒ ProviderUnreachable
constructor
Supports two call styles:.
Constructor Details
#initialize(message = nil, url: nil, reason: nil, details: {}) ⇒ ProviderUnreachable
Supports two call styles:
Woods::MCP::ProviderUnreachable.new(url: "http://...", reason: "timeout")
Woods::MCP::ProviderUnreachable.new("message", details: { ... })
The kwarg form is preferred — probes have url/reason in hand and the message is derived. The positional form exists for callers that already have a formatted message.
115 116 117 118 119 120 121 122 |
# File 'lib/woods/mcp/errors.rb', line 115 def initialize( = nil, url: nil, reason: nil, details: {}) @url = url || details[:url] || details['url'] @reason = reason || details[:reason] || details['reason'] @details = details.dup @details[:url] = @url if @url && !@details.key?(:url) && !@details.key?('url') @details[:reason] = @reason if @reason && !@details.key?(:reason) && !@details.key?('reason') super( || ) end |
Instance Attribute Details
#details ⇒ Hash (readonly)
Returns Structured context forwarded to operators for diagnosis.
105 106 107 |
# File 'lib/woods/mcp/errors.rb', line 105 def details @details end |
#reason ⇒ String (readonly)
Returns Machine-readable failure reason (e.g. “connection_refused”, “timeout”, “http_500”, “unauthorized”, “dns_failure”).
103 104 105 |
# File 'lib/woods/mcp/errors.rb', line 103 def reason @reason end |
#url ⇒ String (readonly)
Returns URL that was probed.
100 101 102 |
# File 'lib/woods/mcp/errors.rb', line 100 def url @url end |