Exception: Toys::ContextualError
- Inherits:
-
StandardError
- Object
- StandardError
- Toys::ContextualError
- Defined in:
- core-docs/toys/errors.rb
Overview
A wrapper exception used to provide user-oriented context for an error
thrown during tool execution. Most exceptions raised during a tool run are
wrapped with one of these (with the original exception set as the cause.)
Signals are not wrapped in this class. A SignalException raised by a tool
propagates as itself, so that tools can intercept it and the Ruby VM can
ultimately handle it. See the error_handler argument to
Runner#initialize for how each is reported.
Defined in the toys-core gem
Instance Attribute Summary collapse
-
#banner ⇒ String
readonly
An overall banner message.
-
#tool_args ⇒ Array<String>
readonly
The arguments passed to the tool that was running when the error occurred.
-
#tool_file_line ⇒ Integer?
(also: #config_line)
readonly
The line number in the toys tool file in which the error was detected.
-
#tool_file_path ⇒ String?
(also: #config_path)
readonly
The path to the toys tool file in which the error was detected.
-
#tool_name ⇒ Array<String>
readonly
The full name of the tool that was running or being loaded when the error occurred.
-
#tool_verb ⇒ String?
readonly
The verb in progress when the error occurred.
Instance Method Summary collapse
-
#root_cause ⇒ Exception?
Returns the root cause of this error, i.e.
Instance Attribute Details
#banner ⇒ String (readonly)
An overall banner message
81 82 83 |
# File 'core-docs/toys/errors.rb', line 81 def @banner end |
#tool_args ⇒ Array<String> (readonly)
The arguments passed to the tool that was running when the error occurred.
124 125 126 |
# File 'core-docs/toys/errors.rb', line 124 def tool_args @tool_args end |
#tool_file_line ⇒ Integer? (readonly) Also known as: config_line
The line number in the toys tool file in which the error was detected.
100 101 102 |
# File 'core-docs/toys/errors.rb', line 100 def tool_file_line @tool_file_line end |
#tool_file_path ⇒ String? (readonly) Also known as: config_path
The path to the toys tool file in which the error was detected.
90 91 92 |
# File 'core-docs/toys/errors.rb', line 90 def tool_file_path @tool_file_path end |
#tool_name ⇒ Array<String> (readonly)
The full name of the tool that was running or being loaded when the error occurred.
117 118 119 |
# File 'core-docs/toys/errors.rb', line 117 def tool_name @tool_name end |
#tool_verb ⇒ String? (readonly)
The verb in progress when the error occurred.
109 110 111 |
# File 'core-docs/toys/errors.rb', line 109 def tool_verb @tool_verb end |
Instance Method Details
#root_cause ⇒ Exception?
Returns the root cause of this error, i.e. the first cause in the chain that is not itself a ContextualError.
134 135 136 |
# File 'core-docs/toys/errors.rb', line 134 def root_cause # Source available in the toys-core gem end |