Exception: RemoteRuby::RemoteError
- Inherits:
-
StandardError
- Object
- StandardError
- RemoteRuby::RemoteError
- Defined in:
- lib/remote_ruby/remote_error.rb
Overview
Raised when an error occurs during remote execution Wraps the original error and provides additional information about the error and the source code that caused it. Allows to display the source code around the line that caused the error.
Instance Attribute Summary collapse
-
#code_source ⇒ Object
readonly
Returns the value of attribute code_source.
-
#remote_context ⇒ Object
readonly
Returns the value of attribute remote_context.
-
#source_path ⇒ Object
readonly
Returns the value of attribute source_path.
-
#stack_trace_regexp ⇒ Object
readonly
Returns the value of attribute stack_trace_regexp.
Instance Method Summary collapse
-
#initialize(code_source, remote_context, source_path) ⇒ RemoteError
constructor
A new instance of RemoteError.
Constructor Details
#initialize(code_source, remote_context, source_path) ⇒ RemoteError
Returns a new instance of RemoteError.
12 13 14 15 16 17 18 |
# File 'lib/remote_ruby/remote_error.rb', line 12 def initialize(code_source, remote_context, source_path) @code_source = code_source @remote_context = remote_context @source_path = source_path @stack_trace_regexp = /^#{Regexp.escape(remote_context.file_name)}:(?<line_number>\d+):in (?<method_name>.*)$/ super() end |
Instance Attribute Details
#code_source ⇒ Object (readonly)
Returns the value of attribute code_source.
10 11 12 |
# File 'lib/remote_ruby/remote_error.rb', line 10 def code_source @code_source end |
#remote_context ⇒ Object (readonly)
Returns the value of attribute remote_context.
10 11 12 |
# File 'lib/remote_ruby/remote_error.rb', line 10 def remote_context @remote_context end |
#source_path ⇒ Object (readonly)
Returns the value of attribute source_path.
10 11 12 |
# File 'lib/remote_ruby/remote_error.rb', line 10 def source_path @source_path end |
#stack_trace_regexp ⇒ Object (readonly)
Returns the value of attribute stack_trace_regexp.
10 11 12 |
# File 'lib/remote_ruby/remote_error.rb', line 10 def stack_trace_regexp @stack_trace_regexp end |