Module: Diffend::HandleErrors::BuildExceptionPayload

Defined in:
lib/diffend/handle_errors/build_exception_payload.rb

Overview

Module responsible for building exception payload

Class Method Summary collapse

Class Method Details

.call(exception, payload) ⇒ Hash

Build exception payload

Parameters:

  • exception (Exception, NilClass)

    expection that was raised

  • payload (Hash)

    with versions to check

Returns:

  • (Hash)


16
17
18
19
20
21
22
23
24
25
26
# File 'lib/diffend/handle_errors/build_exception_payload.rb', line 16

def call(exception, payload)
  {
    request_id: SecureRandom.uuid,
    payload: payload,
    exception: {
      class: exception&.class,
      message: exception&.message,
      backtrace: exception&.backtrace
    }
  }.freeze
end