Exception: Roby::CodeError
- Inherits:
-
LocalizedError
- Object
- RuntimeError
- LocalizedError
- Roby::CodeError
- Defined in:
- lib/roby/standard_errors.rb
Overview
Raised when a user-provided code block (i.e. a code block which is outside of Roby’s plan management algorithms) has raised. This includes: event commands, event handlers, task polling blocks, …
Direct Known Subclasses
CommandFailed, EmissionFailed, EventHandlerError, FailedExceptionHandler
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
The original exception object.
Attributes inherited from LocalizedError
#failed_event, #failed_generator, #failed_task, #failure_point
Instance Method Summary collapse
-
#initialize(error, *args) ⇒ CodeError
constructor
Create a CodeError object from the given original exception object, and with the given failure point.
-
#pretty_print(pp) ⇒ Object
:nodoc:.
Methods inherited from LocalizedError
Constructor Details
#initialize(error, *args) ⇒ CodeError
Create a CodeError object from the given original exception object, and with the given failure point
92 93 94 95 96 97 98 |
# File 'lib/roby/standard_errors.rb', line 92 def initialize(error, *args) if error && !error.kind_of?(Exception) raise TypeError, "#{error} should be an exception" end super(*args) @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
The original exception object
89 90 91 |
# File 'lib/roby/standard_errors.rb', line 89 def error @error end |
Instance Method Details
#pretty_print(pp) ⇒ Object
:nodoc:
100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/roby/standard_errors.rb', line 100 def pretty_print(pp) # :nodoc: if error pp.text "#{self.class.name}: user code raised an exception " failure_point.pretty_print(pp) pp.breakable pp.breakable error.pretty_print(pp) else super end end |