Exception: CSVPlusPlus::Language::SyntaxError
- Defined in:
- lib/csv_plus_plus/language/syntax_error.rb
Overview
An error that can be thrown for various syntax errors
Instance Method Summary collapse
-
#initialize(message, bad_input, runtime, wrapped_error: nil) ⇒ SyntaxError
constructor
A new instance of SyntaxError.
- #to_s ⇒ String
-
#to_trace ⇒ String
Output a user-helpful string that references the runtime state.
-
#to_verbose_trace ⇒ Object
Output a verbose user-helpful string that references the current runtime.
Constructor Details
#initialize(message, bad_input, runtime, wrapped_error: nil) ⇒ SyntaxError
Returns a new instance of SyntaxError.
12 13 14 15 16 17 18 19 |
# File 'lib/csv_plus_plus/language/syntax_error.rb', line 12 def initialize(, bad_input, runtime, wrapped_error: nil) @bad_input = bad_input.to_s @runtime = runtime @wrapped_error = wrapped_error @message = super() end |
Instance Method Details
#to_s ⇒ String
22 23 24 |
# File 'lib/csv_plus_plus/language/syntax_error.rb', line 22 def to_s to_trace end |
#to_trace ⇒ String
Output a user-helpful string that references the runtime state
36 37 38 |
# File 'lib/csv_plus_plus/language/syntax_error.rb', line 36 def to_trace "#{}#{cell_index} #{}" end |
#to_verbose_trace ⇒ Object
Output a verbose user-helpful string that references the current runtime
27 28 29 30 31 |
# File 'lib/csv_plus_plus/language/syntax_error.rb', line 27 def to_verbose_trace warn(@wrapped_error.) if @wrapped_error warn(@wrapped_error.backtrace) if @wrapped_error to_trace end |