Exception: Roby::TaskStructure::ConflictError

Inherits:
LocalizedError show all
Defined in:
lib/roby/task_structure/conflicts.rb

Overview

Class holding conflict error information

Note that it is not an exception as a failed conflict is usually handled by calling #failed_to_start! on the newly started task

Instance Attribute Summary collapse

Attributes inherited from LocalizedError

#failed_event, #failed_generator, #failed_task, #failure_point

Attributes inherited from ExceptionBase

#original_exceptions

Instance Method Summary collapse

Methods inherited from LocalizedError

#fatal?, #involved_plan_object?, match, #propagated?, #to_execution_exception, to_execution_exception_matcher

Methods included from DRoby::V5::LocalizedErrorDumper

#droby_dump

Methods inherited from ExceptionBase

#each_original_exception, #report_exceptions_from

Methods included from DRoby::V5::ExceptionBaseDumper

#droby_dump

Methods included from DRoby::V5::Builtins::ExceptionDumper

#droby_dump

Constructor Details

#initialize(starting_task, running_tasks) ⇒ ConflictError

Returns a new instance of ConflictError.



83
84
85
86
# File 'lib/roby/task_structure/conflicts.rb', line 83

def initialize(starting_task, running_tasks)
    super(starting_task)
    @starting_task, @running_tasks = starting_task, running_tasks
end

Instance Attribute Details

#running_tasksObject (readonly)

Returns the value of attribute running_tasks.



81
82
83
# File 'lib/roby/task_structure/conflicts.rb', line 81

def running_tasks
  @running_tasks
end

#starting_taskObject (readonly)

Returns the value of attribute starting_task.



81
82
83
# File 'lib/roby/task_structure/conflicts.rb', line 81

def starting_task
  @starting_task
end

Instance Method Details

#pretty_print(pp) ⇒ Object



88
89
90
91
92
93
94
95
96
97
98
# File 'lib/roby/task_structure/conflicts.rb', line 88

def pretty_print(pp)
    pp.text "failed to start "
    starting_task.pretty_print(pp)
    pp.text " because it conflicts with #{running_tasks.size} running tasks"
    pp.nest(2) do
        running_tasks.each do |t|
            pp.breakable
            t.pretty_print(pp)
        end
    end
end