Exception: Syskit::TaskNameAlreadyInUse

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

Overview

Exception raised in RobyApp::Configuration#use_deployment when trying to register a deployment that provides a task identical to an existing task

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task_name, existing_deployment, new_deployment) ⇒ TaskNameAlreadyInUse

Returns a new instance of TaskNameAlreadyInUse



927
928
929
930
# File 'lib/syskit/exceptions.rb', line 927

def initialize(task_name, existing_deployment, new_deployment)
    @task_name, @existing_deployment, @new_deployment =
        task_name, existing_deployment, new_deployment
end

Instance Attribute Details

#existing_deploymentModels::ConfiguredDeployment (readonly)

Returns the already registered deployment

Returns:



923
924
925
# File 'lib/syskit/exceptions.rb', line 923

def existing_deployment
  @existing_deployment
end

#new_deploymentModels::ConfiguredDeployment (readonly)

Returns the new deployment

Returns:



925
926
927
# File 'lib/syskit/exceptions.rb', line 925

def new_deployment
  @new_deployment
end

#task_nameString (readonly)

Returns the problematic task name

Returns:

  • (String)

    the problematic task name



920
921
922
# File 'lib/syskit/exceptions.rb', line 920

def task_name
  @task_name
end

Instance Method Details

#pretty_print(pp) ⇒ Object



932
933
934
935
936
937
938
# File 'lib/syskit/exceptions.rb', line 932

def pretty_print(pp)
    pp.text "trying to register #{task_name} from "
    new_deployment.pretty_print(pp)
    pp.breakable
    pp.text "but it is already provided by "
    existing_deployment.pretty_print(pp)
end