Exception: Insika::ConfigError

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

Overview

Strict configuration violation (item 23 / §8.1 — OpenClaw's config discipline: "recusa boot com chave desconhecida, no silent config compat"). Raised by EnvSchema.enforce! at boot ONLY when strictness is on (INSIKA_CONFIG_STRICT) — by default a bad key WARNS and the engine still boots (last-known-good: a rotated env or a typo never takes the whole service down). findings carries the per-key detail (EnvSchema::Finding) so the operator can fix the config.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, findings: []) ⇒ ConfigError

Returns a new instance of ConfigError.



138
139
140
141
142
143
# File 'lib/insika/errors.rb', line 138

def initialize(message = nil, findings: [])
  @findings = findings || []
  detail = @findings.map { |f| f.respond_to?(:message) ? f.message : f.to_s }.join("; ")
  base = message || "strict config check failed"
  super(detail.empty? ? base : "#{base}: #{detail}")
end

Instance Attribute Details

#findingsObject (readonly)

Returns the value of attribute findings.



136
137
138
# File 'lib/insika/errors.rb', line 136

def findings
  @findings
end