class Roby::ChildFailedError

This exception is raised when a hierarchy relation fails

Attributes

explanation[R]

The Explanation object that describes why the relation failed

mode[R]

@return [Symbol] the fault mode. It can either be :failed_event or

:unreachable_success
relation[R]

The relation parameters (i.e. the hash given to depends_on)

Public Class Methods

new(parent, child, explanation, mode) click to toggle source
Calls superclass method Roby::LocalizedError::new
# File lib/roby/task_structure/dependency.rb, line 853
def initialize(parent, child, explanation, mode)
    @explanation = explanation
    @mode = mode

    events, generators, others = [], [], []
    explanation.elements.each do |e|
        case e
        when Event then events << e
        when EventGenerator then generators << e
        else others << e
        end
    end

    failure_point =
        if events.size > 2 || !others.empty?
            child
        else
            base_event = events.first || generators.first
            if explanation.value.nil? # unreachability
                reason = base_event.unreachability_reason
                if reason.respond_to?(:task) && reason.task == child
                    reason
                else
                    base_event
                end
            elsif base_event.respond_to?(:root_task_sources)
                sources = base_event.root_task_sources
                if sources.size == 1
                    sources.first
                else
                    base_event
                end
            else
                base_event
            end
        end

    super(failure_point)

    report_exceptions_from(explanation)
    @parent   = parent
    @relation = parent[child, TaskStructure::Dependency]
    if @relation
        @relation = @relation.dup
    end
end

Public Instance Methods

backtrace() click to toggle source
# File lib/roby/task_structure/dependency.rb, line 924
def backtrace; [] end
child() click to toggle source

The child in the relation

# File lib/roby/task_structure/dependency.rb, line 844
def child; failed_task end
involved_plan_object?(obj) click to toggle source

True if obj is involved in this exception

# File lib/roby/task_structure/dependency.rb, line 927
def involved_plan_object?(obj)
    super || obj == parent
end