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



409
410
411
# File 'lib/roby/standard_errors.rb', line 409

def initialize(from, to)
    @from, @to = from, to
end

Instance Attribute Details

#fromObject (readonly)

The task being replaced



404
405
406
# File 'lib/roby/standard_errors.rb', line 404

def from
  @from
end

#toObject (readonly)

The task which should have replaced #from



406
407
408
# File 'lib/roby/standard_errors.rb', line 406

def to
  @to
end

Instance Method Details

#pretty_print(pp) ⇒ Object

:nodoc:



412
413
414
415
416
417
418
419
420
# File 'lib/roby/standard_errors.rb', line 412

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