Exception: RfcReader::ErrorContext::ContextError
- Inherits:
-
StandardError
- Object
- StandardError
- RfcReader::ErrorContext::ContextError
- Extended by:
- Forwardable
- Defined in:
- lib/rfc_reader/error_context.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
- #full_message ⇒ Object
-
#initialize(cause:, context: nil) ⇒ ContextError
constructor
A new instance of ContextError.
- #short_message ⇒ Object
Constructor Details
#initialize(cause:, context: nil) ⇒ ContextError
Returns a new instance of ContextError.
16 17 18 19 20 |
# File 'lib/rfc_reader/error_context.rb', line 16 def initialize(cause:, context: nil) @cause = cause @context = context || default_context super end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
10 11 12 |
# File 'lib/rfc_reader/error_context.rb', line 10 def context @context end |
Instance Method Details
#full_message ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rfc_reader/error_context.rb', line 26 def <<~MESSAGE Context: #{indent(@context)} Error: #{@cause.class} Message: #{indent()} Backtrace: #{indent(backtrace)} MESSAGE end |
#short_message ⇒ Object
22 23 24 |
# File 'lib/rfc_reader/error_context.rb', line 22 def "Error: #{context}" end |