Exception: CommandTower::Messaging::Rendering::RenderError

Inherits:
StandardError
  • Object
show all
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

Instance Method Summary collapse

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

#codeObject (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_classObject (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