Exception: Insika::ConfigError

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

Overview

Strict configuration violation (— 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.



194
195
196
197
198
199
# File 'lib/insika/errors.rb', line 194

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.



192
193
194
# File 'lib/insika/errors.rb', line 192

def findings
  @findings
end