Class: Pragma::Operation::Response::InternalServerError

Inherits:
Pragma::Operation::Response show all
Defined in:
lib/pragma/operation/response/internal_server_error.rb

Overview

Represents the 500 Internal Server Error HTTP response.

Constant Summary

Constants inherited from Pragma::Operation::Response

STATUSES

Instance Attribute Summary

Attributes inherited from Pragma::Operation::Response

#entity, #headers, #status

Instance Method Summary collapse

Methods inherited from Pragma::Operation::Response

#decorate_with, #failure?, #success?

Constructor Details

#initialize(entity: Error.new( error_type: :internal_server_error, error_message: 'There was an error processing your request.' ), headers: {}) ⇒ InternalServerError

Initializes the response.

Parameters:

  • entity (Object) (defaults to: Error.new( error_type: :internal_server_error, error_message: 'There was an error processing your request.' ))

    the response’s entity

  • headers (Hash) (defaults to: {})

    the response’s headers



12
13
14
15
16
17
18
19
20
# File 'lib/pragma/operation/response/internal_server_error.rb', line 12

def initialize(
  entity: Error.new(
    error_type: :internal_server_error,
    error_message: 'There was an error processing your request.'
  ),
  headers: {}
)
  super(status: 500, entity: entity, headers: headers)
end