Exception: NRSER::ValueError
- Includes:
- NicerError
- Defined in:
- lib/nrser/errors/value_error.rb
Overview
Raised when there is a problem with a value that does not fall into one of the other built-in exception categories (non-exhaustive list):
-
It’s the wrong type (TypeError)
-
It’s an argument (ArgumentError)
It is encouraged to attach the invalid value as the ‘value:` keyword argument, which is then stored in NicerError#context hash and can be accessed via #value.
Direct Known Subclasses
Constant Summary
Constants included from NicerError
NicerError::DEFAULT_COLUMN_WIDTH
Instance Method Summary collapse
-
#initialize(*message, **kwds) ⇒ Object
constructor
Create a new ValueError.
-
#value ⇒ Object
Get the value at the ‘:value` key in NicerError#context.
-
#value? ⇒ Boolean
‘true` if we have a `:value` key in the NicerError#context.
Methods included from NicerError
#add_extended_message?, column_width, #context, #context_section, #default_message, #details, #details_section, #extended_message, #format_message, #format_message_segment, included, #to_s
Constructor Details
#initialize(*message, **kwds) ⇒ Object
Create a new NRSER::ValueError.
|
# File 'lib/nrser/errors/value_error.rb', line 47
|
Instance Method Details
#value ⇒ Object
Get the value at the ‘:value` key in NicerError#context.
44 |
# File 'lib/nrser/errors/value_error.rb', line 44 def_context_delegator keys: :value |
#value? ⇒ Boolean
‘true` if we have a `:value` key in the NicerError#context.
44 |
# File 'lib/nrser/errors/value_error.rb', line 44 def_context_delegator keys: :value |