Class: JSONAPI::Utils::Exceptions::InternalServerError

Inherits:
Exceptions::Error
  • Object
show all
Defined in:
lib/jsonapi/utils/exceptions/internal_server_error.rb

Instance Method Summary collapse

Instance Method Details

#codeString

HTTP status code

Returns:

  • (String)


10
11
12
# File 'lib/jsonapi/utils/exceptions/internal_server_error.rb', line 10

def code
  '500'
end

#errorsArray

Decorate errors for 500 responses.

Returns:

  • (Array)


19
20
21
22
23
24
25
26
# File 'lib/jsonapi/utils/exceptions/internal_server_error.rb', line 19

def errors
  [JSONAPI::Error.new(
    code: code,
    status: :internal_server_error,
    title: 'Internal Server Error',
    detail: 'An internal error ocurred while processing the request.'
  )]
end