Exception: Roby::Planning::NotFound
- Inherits:
-
PlanModelError
- Object
- RuntimeError
- PlanModelError
- Roby::Planning::NotFound
- Defined in:
- lib/roby/planning/model.rb
Overview
Raised a method has found no valid development
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
A method => error hash of all the method that have been tried.
-
#method_name ⇒ Object
The name of the method which has failed.
-
#method_options ⇒ Object
The planning options.
Attributes inherited from PlanModelError
Instance Method Summary collapse
- #full_message ⇒ Object
-
#initialize(planner, errors) ⇒ NotFound
constructor
A new instance of NotFound.
- #message ⇒ Object
Constructor Details
#initialize(planner, errors) ⇒ NotFound
Returns a new instance of NotFound.
33 34 35 36 |
# File 'lib/roby/planning/model.rb', line 33 def initialize(planner, errors) @errors = errors super(planner) end |
Instance Attribute Details
#errors ⇒ Object (readonly)
A method => error hash of all the method that have been tried. error can either be a NotFound exception or another exception
31 32 33 |
# File 'lib/roby/planning/model.rb', line 31 def errors @errors end |
#method_name ⇒ Object
The name of the method which has failed
25 26 27 |
# File 'lib/roby/planning/model.rb', line 25 def method_name @method_name end |
#method_options ⇒ Object
The planning options
27 28 29 |
# File 'lib/roby/planning/model.rb', line 27 def @method_options end |
Instance Method Details
#full_message ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/roby/planning/model.rb', line 54 def msg = first, *rem = *Roby.filter_backtrace(backtrace) full = "#{first}: #{msg}\n from #{rem.join("\n from ")}" errors.each do |m, error| first = error.backtrace.first full << "\n#{first} #{m} failed because of #{error.}" end full end |
#message ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/roby/planning/model.rb', line 38 def if errors.empty? "no candidate for #{method_name}(#{})" else msg = "cannot develop a #{method_name}(#{}) method" first, *rem = *Roby.filter_backtrace(backtrace) full = "#{first}: #{msg}\n from #{rem.join("\n from ")}" errors.each do |m, error| first, *rem = *Roby.filter_backtrace(error.backtrace) full << "\n#{first}: #{m} failed with #{error.}\n from #{rem.join("\n from ")}" end full end end |