Exception: Roby::InvalidReplace

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/roby/standard_errors.rb

Overview

Raised by Plan#replace when the new task cannot replace the older one.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from, to) ⇒ InvalidReplace

Create a new InvalidReplace object



499
500
501
502
503
# File 'lib/roby/standard_errors.rb', line 499

def initialize(from, to)
    super()

    @from, @to = from, to
end

Instance Attribute Details

#fromObject (readonly)

The task being replaced



494
495
496
# File 'lib/roby/standard_errors.rb', line 494

def from
  @from
end

#toObject (readonly)

The task which should have replaced #from



496
497
498
# File 'lib/roby/standard_errors.rb', line 496

def to
  @to
end

Instance Method Details

#pretty_print(pp) ⇒ Object

:nodoc:



505
506
507
508
509
510
511
512
513
# File 'lib/roby/standard_errors.rb', line 505

def pretty_print(pp) # :nodoc:
    pp.text "invalid replacement: #{message}"
    pp.breakable
    pp.text "from "
    from.pretty_print(pp)
    pp.breakable
    pp.text "to "
    to.pretty_print(pp)
end