32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/legion/cli/chat/tools/manage_schedules.rb', line 32
def execute(action:, **)
action = action.to_s.strip
return "Invalid action: #{action}. Use: #{VALID_ACTIONS.join(', ')}" unless VALID_ACTIONS.include?(action)
send(:"handle_#{action}", **)
rescue Errno::ECONNREFUSED
'Legion daemon not running (cannot reach schedules API).'
rescue StandardError => e
Legion::Logging.warn("ManageSchedules#execute failed: #{e.message}") if defined?(Legion::Logging)
"Error managing schedules: #{e.message}"
end
|