Exception: CSVPlusPlus::Error::ModifierSyntaxError
- Inherits:
-
SyntaxError
- Object
- StandardError
- Error
- SyntaxError
- CSVPlusPlus::Error::ModifierSyntaxError
- Extended by:
- T::Sig
- Defined in:
- lib/csv_plus_plus/error/modifier_syntax_error.rb
Overview
An Error that wraps a ModifierValidationError with a Runtime.
Instance Attribute Summary collapse
-
#bad_input ⇒ Object
readonly
Returns the value of attribute bad_input.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#modifier ⇒ Object
readonly
Returns the value of attribute modifier.
Class Method Summary collapse
-
.from_validation_error(runtime, modifier_validation_error) ⇒ ModifierSyntaxError
Create a
ModifierSyntaxErrorgiven aruntimeandModifierValidationError.
Instance Method Summary collapse
-
#error_message ⇒ ::String
Create a relevant error message given @choices or @message (one of them must be supplied).
-
#initialize(runtime, bad_input:, message:, modifier: nil, wrapped_error: nil) ⇒ ModifierSyntaxError
constructor
A new instance of ModifierSyntaxError.
Methods inherited from SyntaxError
#to_s, #to_trace, #to_verbose_trace
Constructor Details
#initialize(runtime, bad_input:, message:, modifier: nil, wrapped_error: nil) ⇒ ModifierSyntaxError
Returns a new instance of ModifierSyntaxError.
54 55 56 57 58 59 60 |
# File 'lib/csv_plus_plus/error/modifier_syntax_error.rb', line 54 def initialize(runtime, bad_input:, message:, modifier: nil, wrapped_error: nil) @bad_input = bad_input @modifier = modifier @message = super(runtime, wrapped_error:) end |
Instance Attribute Details
#bad_input ⇒ Object (readonly)
Returns the value of attribute bad_input.
13 14 15 |
# File 'lib/csv_plus_plus/error/modifier_syntax_error.rb', line 13 def bad_input @bad_input end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
16 17 18 |
# File 'lib/csv_plus_plus/error/modifier_syntax_error.rb', line 16 def @message end |
#modifier ⇒ Object (readonly)
Returns the value of attribute modifier.
19 20 21 |
# File 'lib/csv_plus_plus/error/modifier_syntax_error.rb', line 19 def modifier @modifier end |
Class Method Details
.from_validation_error(runtime, modifier_validation_error) ⇒ ModifierSyntaxError
Create a ModifierSyntaxError given a runtime and ModifierValidationError.
33 34 35 36 37 38 39 40 41 |
# File 'lib/csv_plus_plus/error/modifier_syntax_error.rb', line 33 def self.from_validation_error(runtime, modifier_validation_error) new( runtime, modifier: modifier_validation_error.modifier, bad_input: modifier_validation_error.bad_input, message: modifier_validation_error., wrapped_error: modifier_validation_error ) end |
Instance Method Details
#error_message ⇒ ::String
Create a relevant error message given @choices or @message (one of them must be supplied).
66 67 68 69 70 71 72 |
# File 'lib/csv_plus_plus/error/modifier_syntax_error.rb', line 66 def <<~ERROR_MESSAGE Error parsing modifier: [[#{@modifier}=...]] Bad input: #{@bad_input} Reason: #{@message} ERROR_MESSAGE end |