Exception: CSVPlusPlus::Error::FormulaSyntaxError
- Inherits:
-
SyntaxError
- Object
- StandardError
- Error
- SyntaxError
- CSVPlusPlus::Error::FormulaSyntaxError
- 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.
Instance Method Summary collapse
-
#error_message ⇒ ::String
Create a relevant error message given @bad_input and @message.
-
#initialize(message, bad_input, runtime, wrapped_error: nil) ⇒ FormulaSyntaxError
constructor
You must supply either a
choicesormessage.
Methods inherited from SyntaxError
#to_s, #to_trace, #to_verbose_trace
Constructor Details
#initialize(message, bad_input, runtime, wrapped_error: nil) ⇒ FormulaSyntaxError
You must supply either a choices or message
21 22 23 24 25 26 |
# File 'lib/csv_plus_plus/error/formula_syntax_error.rb', line 21 def initialize(, bad_input, runtime, wrapped_error: nil) @bad_input = bad_input @message = super(runtime, wrapped_error:) end |
Instance Attribute Details
#bad_input ⇒ String (readonly)
The offending input that caused the error to be thrown
11 12 13 |
# File 'lib/csv_plus_plus/error/formula_syntax_error.rb', line 11 def bad_input @bad_input end |
#message ⇒ ::String (readonly)
A helpful error message
11 12 13 |
# File 'lib/csv_plus_plus/error/formula_syntax_error.rb', line 11 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 "#{@message}: \"#{@bad_input}\"" end |