Exception: Syskit::UnknownServiceName
- Defined in:
- lib/syskit/exceptions.rb
Overview
Exception raised when a service of a given name is required but none can be found on a particular task context model
Instance Attribute Summary collapse
-
#component_model ⇒ Model<Component>
readonly
The component on which we were looking for a given service.
-
#service_name ⇒ String
readonly
The service name.
Instance Method Summary collapse
-
#initialize(component_model, service_name) ⇒ UnknownServiceName
constructor
A new instance of UnknownServiceName.
- #pretty_print(pp) ⇒ Object
Constructor Details
#initialize(component_model, service_name) ⇒ UnknownServiceName
Returns a new instance of UnknownServiceName
163 164 165 |
# File 'lib/syskit/exceptions.rb', line 163 def initialize(component_model, service_name) @component_model, @service_name = component_model, service_name end |
Instance Attribute Details
#component_model ⇒ Model<Component> (readonly)
Returns the component on which we were looking for a given service
159 160 161 |
# File 'lib/syskit/exceptions.rb', line 159 def component_model @component_model end |
#service_name ⇒ String (readonly)
Returns the service name
161 162 163 |
# File 'lib/syskit/exceptions.rb', line 161 def service_name @service_name end |
Instance Method Details
#pretty_print(pp) ⇒ Object
167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/syskit/exceptions.rb', line 167 def pretty_print(pp) pp.text "cannot find service #{service_name} in #{component_model.short_name}" pp.text "the services of #{component_model.short_name} are:" pp.nest(2) do pp.breakable pp.seplist(component_model.each_data_service.to_a) do |srv| _, srv = *srv pp.text "#{srv.full_name}: #{srv.model.short_name}" end end end |