Exception: Toys::ContextualError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/toys/errors.rb

Overview

A wrapper exception used to provide user-oriented context for an error thrown during tool execution.

Instance Attribute Summary collapse

Instance Attribute Details

An overall banner message

Returns:

  • (String)


73
74
75
# File 'lib/toys/errors.rb', line 73

def banner
  @banner
end

#cause::StandardError (readonly)

The underlying exception

Returns:

  • (::StandardError)


67
68
69
# File 'lib/toys/errors.rb', line 67

def cause
  @cause
end

#config_lineInteger

The line number in the toys config file in which the error was detected

Returns:

  • (Integer)


85
86
87
# File 'lib/toys/errors.rb', line 85

def config_line
  @config_line
end

#config_pathString

The path to the toys config file in which the error was detected

Returns:

  • (String)


79
80
81
# File 'lib/toys/errors.rb', line 79

def config_path
  @config_path
end

#tool_argsArray<String>

The arguments passed to the tool that was running when the error occurred

Returns:

  • (Array<String>)


97
98
99
# File 'lib/toys/errors.rb', line 97

def tool_args
  @tool_args
end

#tool_nameArray<String>

The full name of the tool that was running when the error occurred

Returns:

  • (Array<String>)


91
92
93
# File 'lib/toys/errors.rb', line 91

def tool_name
  @tool_name
end