aboutsummaryrefslogtreecommitdiff
path: root/src/serializers/error_serializer.cr
blob: 21a53aa298c1b6af9dd358dd96478962bb746421 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# This is the default error serializer generated by Lucky.
# Feel free to customize it in any way you like.
class ErrorSerializer < BaseSerializer
  def initialize(
    @message : String,
    @details : String? = nil,
    @param : String? = nil # so you can track which param (if any) caused the problem
  )
  end

  def render
    {message: @message, param: @param, details: @details}
  end
end