Exception: CSVPlusPlus::Error::SyntaxError
- Extended by:
- T::Sig
- Defined in:
- lib/csv_plus_plus/error/syntax_error.rb
Overview
An error that can be thrown for various syntax errors
Direct Known Subclasses
Instance Method Summary collapse
- #error_message ⇒ ::String
-
#initialize(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(runtime, wrapped_error: nil) ⇒ SyntaxError
Returns a new instance of SyntaxError.
14 15 16 17 18 19 |
# File 'lib/csv_plus_plus/error/syntax_error.rb', line 14 def initialize(runtime, wrapped_error: nil) @runtime = runtime @wrapped_error = wrapped_error super() end |
Instance Method Details
#error_message ⇒ ::String
30 31 32 |
# File 'lib/csv_plus_plus/error/syntax_error.rb', line 30 def '' end |
#to_s ⇒ ::String
23 24 25 |
# File 'lib/csv_plus_plus/error/syntax_error.rb', line 23 def to_s to_trace end |
#to_trace ⇒ String
Output a user-helpful string that references the runtime state
46 47 48 |
# File 'lib/csv_plus_plus/error/syntax_error.rb', line 46 def to_trace "#{}#{cell_index} #{}" end |
#to_verbose_trace ⇒ Object
Output a verbose user-helpful string that references the current runtime
36 37 38 39 40 |
# File 'lib/csv_plus_plus/error/syntax_error.rb', line 36 def to_verbose_trace warn(@wrapped_error.) if @wrapped_error warn((@wrapped_error.backtrace || []).join("\n")) if @wrapped_error&.backtrace to_trace end |