Exception: CSVPlusPlus::Error::FormulaSyntaxError
- Extended by:
- T::Sig
- Includes:
- PositionalError
- Defined in:
- lib/csv_plus_plus/error/formula_syntax_error.rb
Overview
An error that can be thrown when there is an error parsing a modifier
Instance Attribute Summary collapse
-
#bad_input ⇒ String
readonly
The offending input that caused the error to be thrown.
-
#message ⇒ ::String
readonly
A helpful error message.
Attributes inherited from Error
Instance Method Summary collapse
-
#error_message ⇒ ::String
Create a relevant error message given @bad_input and @message.
-
#initialize(message, bad_input:, wrapped_error: nil) ⇒ FormulaSyntaxError
constructor
A new instance of FormulaSyntaxError.
Constructor Details
#initialize(message, bad_input:, wrapped_error: nil) ⇒ FormulaSyntaxError
Returns a new instance of FormulaSyntaxError.
22 23 24 25 |
# File 'lib/csv_plus_plus/error/formula_syntax_error.rb', line 22 def initialize(, bad_input:, wrapped_error: nil) super(, wrapped_error:) @bad_input = bad_input end |
Instance Attribute Details
#bad_input ⇒ String (readonly)
The offending input that caused the error to be thrown
10 11 12 |
# File 'lib/csv_plus_plus/error/formula_syntax_error.rb', line 10 def bad_input @bad_input end |
#message ⇒ ::String (readonly)
A helpful error message
10 11 12 |
# File 'lib/csv_plus_plus/error/formula_syntax_error.rb', line 10 def @message end |
Instance Method Details
#error_message ⇒ ::String
Create a relevant error message given @bad_input and @message.
31 32 33 |
# File 'lib/csv_plus_plus/error/formula_syntax_error.rb', line 31 def "#{}: \"#{bad_input}\"" end |