Exception: Textus::Contract::MissingArgs

Inherits:
Error
  • Object
show all
Defined in:
lib/textus/contract/binder.rb

Overview

Raised when a required arg is absent from the bound input. Surface adapters translate this to their native error (MCP ToolError, CLI UsageError); a direct Ruby call lets it surface as-is.

Instance Attribute Summary collapse

Attributes inherited from Error

#code, #details, #exit_code, #hint

Instance Method Summary collapse

Methods inherited from Error

#to_envelope

Constructor Details

#initialize(spec, missing) ⇒ MissingArgs

Returns a new instance of MissingArgs.



9
10
11
12
13
# File 'lib/textus/contract/binder.rb', line 9

def initialize(spec, missing)
  @spec = spec
  @missing = missing
  super("missing_args", "#{spec.verb}: missing #{missing.map(&:wire).join(", ")}")
end

Instance Attribute Details

#missingObject (readonly)

Returns the value of attribute missing.



7
8
9
# File 'lib/textus/contract/binder.rb', line 7

def missing
  @missing
end

#specObject (readonly)

Returns the value of attribute spec.



7
8
9
# File 'lib/textus/contract/binder.rb', line 7

def spec
  @spec
end