Exception: LightServiceExt::ContextError
- Inherits:
-
StandardError
- Object
- StandardError
- LightServiceExt::ContextError
- Defined in:
- lib/light-service-ext/context_error.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#error_info ⇒ Object
readonly
Returns the value of attribute error_info.
Instance Method Summary collapse
-
#initialize(ctx:, error: nil, message: nil, fatal: false) ⇒ ContextError
constructor
A new instance of ContextError.
- #message ⇒ Object
Constructor Details
#initialize(ctx:, error: nil, message: nil, fatal: false) ⇒ ContextError
Returns a new instance of ContextError.
13 14 15 16 17 18 19 |
# File 'lib/light-service-ext/context_error.rb', line 13 def initialize(ctx:, error: nil, message: nil, fatal: false) super @error = error @context = ctx = .presence || "Organizer completed with unhandled errors: \n#{formatted_validation_errors}" @error_info = ErrorInfo.new(error, message: , fatal: fatal) end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
5 6 7 |
# File 'lib/light-service-ext/context_error.rb', line 5 def context @context end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
5 6 7 |
# File 'lib/light-service-ext/context_error.rb', line 5 def error @error end |
#error_info ⇒ Object (readonly)
Returns the value of attribute error_info.
5 6 7 |
# File 'lib/light-service-ext/context_error.rb', line 5 def error_info @error_info end |
Instance Method Details
#message ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/light-service-ext/context_error.rb', line 21 def = " \\nOrganizer: \#{organizer_name}\n Action: \#{action_name} failed with errors:\n Validation Errors: \#{formatted_validation_errors}\n TEXT\n error_message = \"\#{error_message}\\n\#{error_info.error_summary}\" if error\n error_message\nend\n" |