Exception: Syskit::InvalidAutoConnection

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/syskit/exceptions.rb

Overview

Raised when trying to autoconnect two objects, but no connections could be found

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, sink) ⇒ InvalidAutoConnection

Returns a new instance of InvalidAutoConnection



666
667
668
# File 'lib/syskit/exceptions.rb', line 666

def initialize(source, sink)
    @source, @sink = source, sink
end

Instance Attribute Details

#sinkObject (readonly)

Returns the value of attribute sink



665
666
667
# File 'lib/syskit/exceptions.rb', line 665

def sink
  @sink
end

#sourceObject (readonly)

Returns the value of attribute source



665
666
667
# File 'lib/syskit/exceptions.rb', line 665

def source
  @source
end

Instance Method Details

#pretty_print(pp) ⇒ Object



670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
# File 'lib/syskit/exceptions.rb', line 670

def pretty_print(pp)
    pp.text "could not find any connections from #{source.short_name} to #{sink.short_name}"
    if source.respond_to?(:each_output_port)
        pp.nest(2) do
            pp.breakable
            pp.text "the outputs of #{source.short_name} are"
            pp.nest(2) do
                pp.breakable
                pp.seplist(source.each_output_port) do |out_p|
                    pp.text "#{out_p.name}[#{out_p.type.name}]"
                end
            end
        end
    end
    if sink.respond_to?(:each_input_port)
        pp.nest(2) do
            pp.breakable
            pp.text "the inputs of #{sink.short_name} are"
            pp.nest(2) do
                pp.breakable
                pp.seplist(sink.each_input_port) do |in_p|
                    pp.text "#{in_p.name}[#{in_p.type.name}]"
                end
            end
        end
    end
end