Core/Handlers/MessageHandler.php
private function addCallbackHeadersToEnvelope(CallbackExchangeEnvelope $envelope, ProcessingException $exception, ProcessorInterface $processor)
    {
        $originalException = $exception->getOriginalException();
        $errorDescription = $originalException ? $originalException->getMessage() : $exception->getMessage();

        $envelope->setHeader(CallbackExchangeEnvelope::HEADER_CREATED_AT, round(microtime(true) * 1000));
        $envelope->setHeader(CallbackExchangeEnvelope::HEADER_ERROR_MESSAGE, $errorDescription);
        $envelope->setHeader(CallbackExchangeEnvelope::HEADER_ERROR_PROCESSOR_ID, $processor->getId());
        $envelope->setHeader(CallbackExchangeEnvelope::HEADER_ERROR_PROCESSOR_DESCRIPTION, $processor->getDescription());
        $envelope->setHeader(CallbackExchangeEnvelope::HEADER_STATUS_CODE, $originalException->getCode());
    }
private function addCallbackHeadersToEnvelope(CallbackExchangeEnvelope $envelope, ProcessingException $exception, ProcessorInterface $processor)
    {
        $originalException = $exception->getOriginalException();
        $errorDescription = $originalException ? $originalException->getMessage() : $exception->getMessage();

        $envelope->setHeader(CallbackExchangeEnvelope::HEADER_CREATED_AT, round(microtime(true) * 1000));
        $envelope->setHeader(CallbackExchangeEnvelope::HEADER_ERROR_MESSAGE, $errorDescription);
        $envelope->setHeader(CallbackExchangeEnvelope::HEADER_ERROR_PROCESSOR_ID, $processor->getId());
        $envelope->setHeader(CallbackExchangeEnvelope::HEADER_ERROR_PROCESSOR_DESCRIPTION, $processor->getDescription());
        $envelope->setHeader(CallbackExchangeEnvelope::HEADER_STATUS_CODE, $originalException->getCode());
    }
private function addCallbackHeadersToEnvelope ( CallbackExchangeEnvelope $ envelope , ProcessingException $ exception , ProcessorInterface $ processor ) { $ originalException = $ exception -> getOriginalException ( ) ; $ errorDescription = $ originalException ? $ originalException -> getMessage ( ) : $ exception -> getMessage ( ) ; $ envelope -> setHeader ( CallbackExchangeEnvelope :: HEADER_CREATED_AT , round ( microtime ( true ) * 1000 ) ) ; $ envelope -> setHeader ( CallbackExchangeEnvelope :: HEADER_ERROR_MESSAGE , $ errorDescription ) ; $ envelope -> setHeader ( CallbackExchangeEnvelope :: HEADER_ERROR_PROCESSOR_ID , $ processor -> getId ( ) ) ; $ envelope -> setHeader ( CallbackExchangeEnvelope :: HEADER_ERROR_PROCESSOR_DESCRIPTION , $ processor -> getDescription ( ) ) ; $ envelope -> setHeader ( CallbackExchangeEnvelope :: HEADER_STATUS_CODE , $ originalException -> getCode ( ) ) ; }
This method adds headers to the Envelope that we put the Callback exchange into, this is so that the
consumer of the has information to do deal with it.

- add the last error message and the time the error happened
- add information about the processor that was being used when the event occurred

@param CallbackExchangeEnvelope $envelope
@param ProcessingException      $exception
@param ProcessorInterface       $processor
This method adds headers to the Envelope that we put the Callback exchange into this is so that the consumer of the has information to do deal with it .