Class: CommandTower::Serializers::Application::ErrorEntrySerializer

Inherits:
Object
  • Object
show all
Defined in:
app/serializers/command_tower/serializers/application/error_entry_serializer.rb

Class Method Summary collapse

Class Method Details

.serialize(error) ⇒ Object



7
8
9
10
11
12
13
14
# File 'app/serializers/command_tower/serializers/application/error_entry_serializer.rb', line 7

def self.serialize(error)
  entry = {
    code: error.code,
    message: error.message
  }
  entry[:details] = error.details if error.details.present?
  entry
end