Class: Hoodoo::Services::Middleware::ExceptionReporting::Payload

Inherits:
Object
  • Object
show all
Defined in:
lib/hoodoo/services/middleware/exception_reporting/exception_reporting.rb

Overview

Implementation detail of Hoodoo::Services::Middleware::ExceptionReporting used to carry multiple parameters describing exception related data through the Hoodoo::Communicators::Pool#communicate mechanism.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception:, rack_env: nil, context: nil) ⇒ Payload

Initialize this instance with named parameters:

exception

Exception (or Exception subclass) instance. Mandatory.

rack_env

Rack environment hash. Optional.

context

Hoodoo::Services::Context instance. Optional.



128
129
130
131
132
# File 'lib/hoodoo/services/middleware/exception_reporting/exception_reporting.rb', line 128

def initialize( exception:, rack_env: nil, context: nil )
  @exception = exception
  @rack_env  = rack_env
  @context   = context
end

Instance Attribute Details

#contextObject

A Hoodoo::Services::Context instance describing the in-flight request/response cycle, if there is one. May be nil.



120
121
122
# File 'lib/hoodoo/services/middleware/exception_reporting/exception_reporting.rb', line 120

def context
  @context
end

#exceptionObject

Exception (or Exception subclass) instance.



111
112
113
# File 'lib/hoodoo/services/middleware/exception_reporting/exception_reporting.rb', line 111

def exception
  @exception
end

#rack_envObject

Rack environment (the unprocessed, original Hash). May be nil.



115
116
117
# File 'lib/hoodoo/services/middleware/exception_reporting/exception_reporting.rb', line 115

def rack_env
  @rack_env
end