Exception: Pikuri::Command::RefusedError
- Inherits:
-
StandardError
- Object
- StandardError
- Pikuri::Command::RefusedError
- Defined in:
- lib/pikuri/command/refused_error.rb
Overview
Raised by Pikuri::Command::Registry#get for a command that exists on disk but cannot be
run — it declares allowed-tools:, or its body carries a
!cmd</code> directive.
Host-facing: it never reaches a tool, so the +"Error: …"+-string convention for model-visible failures does not apply. A REPL rescues it and prints {#message}; the command stays in {Registry#list} so a menu can still show it, greyed out or not.
begin
text = registry.expand(name, arguments: args)
rescue Pikuri::Command::RefusedError => e
puts "/#{name} is unavailable — #{e.message}"
next
end
Instance Attribute Summary collapse
-
#location ⇒ String
readonly
Path of the command file.
Instance Method Summary collapse
-
#initialize(location, reason) ⇒ RefusedError
constructor
A new instance of RefusedError.
Constructor Details
#initialize(location, reason) ⇒ RefusedError
Returns a new instance of RefusedError.
27 28 29 30 |
# File 'lib/pikuri/command/refused_error.rb', line 27 def initialize(location, reason) @location = location super("#{location}: #{reason}") end |
Instance Attribute Details
#location ⇒ String (readonly)
Returns path of the command file.
22 23 24 |
# File 'lib/pikuri/command/refused_error.rb', line 22 def location @location end |