Exception: CommandTower::Messaging::Rendering::RenderError
- Inherits:
-
StandardError
- Object
- StandardError
- CommandTower::Messaging::Rendering::RenderError
- Defined in:
- app/services/command_tower/messaging/rendering/render_error.rb
Constant Summary collapse
- CODES =
%w[recipient_missing render_failed].freeze
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#error_class ⇒ Object
readonly
Returns the value of attribute error_class.
Instance Method Summary collapse
-
#initialize(code:, error_class: nil) ⇒ RenderError
constructor
A new instance of RenderError.
Constructor Details
#initialize(code:, error_class: nil) ⇒ RenderError
Returns a new instance of RenderError.
11 12 13 14 15 16 17 18 19 20 |
# File 'app/services/command_tower/messaging/rendering/render_error.rb', line 11 def initialize(code:, error_class: nil) normalized = code.to_s unless CODES.include?(normalized) raise ArgumentError, "unsupported render error code: #{code.inspect}" end @code = normalized @error_class = error_class.nil? ? nil : error_class.to_s super(normalized) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
9 10 11 |
# File 'app/services/command_tower/messaging/rendering/render_error.rb', line 9 def code @code end |
#error_class ⇒ Object (readonly)
Returns the value of attribute error_class.
9 10 11 |
# File 'app/services/command_tower/messaging/rendering/render_error.rb', line 9 def error_class @error_class end |