class Roby::CodeError

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, …

Public Class Methods

match() click to toggle source

Create a {Queries::CodeErrorMatcher} that matches this exception

@return [Queries::CodeErrorMatcher]

# File lib/roby/standard_errors.rb, line 287
def self.match
    Roby::Queries::CodeErrorMatcher.new.with_model(self)
end
new(error, *args) click to toggle source

Create a CodeError object from the given original exception object, and with the given failure point

Calls superclass method Roby::LocalizedError::new
# File lib/roby/standard_errors.rb, line 271
def initialize(error, *args)
    if error && !error.kind_of?(Exception)
        raise TypeError, "#{error} should be an exception"
    end
    super(*args)
    report_exceptions_from(error)
end

Public Instance Methods

error() click to toggle source

@deprecated use {#original_exception} instead

# File lib/roby/standard_errors.rb, line 268
def error; original_exception end
original_exception() click to toggle source

The original exception object

# File lib/roby/standard_errors.rb, line 266
def original_exception; original_exceptions.first end
pretty_print(pp) click to toggle source
# File lib/roby/standard_errors.rb, line 279
def pretty_print(pp)
    pp.text "#{self.class.name}: user code raised an exception "
    failure_point.pretty_print(pp)
end