lib/apia/rack.rb
# Return a triplet for a given error using the standard error schema
#
# @param code [String]
# @param description [String]
# @param detail [Hash]
# @param status [Integer]
# @param headers [Hash]
# @return [Array]
Return a triplet for a given error using the standard error schema
Return a triplet for a given error using the standard error schema
def error_triplet(code, description: nil, detail: {}, status: 500, headers: {})
        json_triplet({
                       error: {
                         code: code,
                         description: description,
                         detail: detail
                       }
                     }, status: status, headers: headers.merge('x-api-schema' => 'json-error'))
      end
def error_triplet ( code , description : nil , detail : { } , status : 500 , headers : { } ) json_triplet ( { error : { code : code , description : description , detail : detail } } , status : status , headers : headers . merge ( 'x-api-schema' => 'json-error' ) ) end
Return a triplet for a given error using the standard error schema
Return a triplet for a given error using the standard error schema
None
Array
code
<not_specific>
description
<not_specific>
detail
<not_specific>
status
<not_specific>
headers
<not_specific>
<not_specific>
None